i try, since several month, the executewithresultsandmessages method in vbs to get a resultset and the generated messages from sqlserver.
but it doesnt work. i only get the resultset but no messages.
also the documentation on MS site has wrong syntax.
thats what i try:
Set objSQLServer = CreateObject("SQLDMO.SQLServer")
Set objDB = objSQLServer.Databases("mydbname")
tblQuery = "SELECT * from [mytable]"
Set tblResult = objdb.ExecuteWithResultsAndMessages(tblQuery, sMessages, Len(tblQuery))
for this, i expect some rows in the resultset and something like "n rows affected" in the message field.
or if the statement is like print 'hello', i expect the 'hello' in the message field/variable, but nothing.
I read that some people got messages with c# or VB6 but no one got success with VBS.
I have tried every sample i found on internet, but nothing works.
Also, i have no idea how that should work with a variable because the message could be more than one line.
i am very glad if someone have a working sample for me
p.s. its not helpful to get answers like, doit with powershell or doit with smo. i need it in vbs !
View Complete Post