Forum Discussion
Hi,
> Multiple-step OLE DB operation generated errors.
This means that executed SQL contained more than one statement. ADO supports one statement per SQL, so instead of batch SQL execution you need to execute it line-by-line.
- whuang6 years agoRegular Contributor
Hi AlexKaras , I asked our database guy to take a look at my script below, and he doesn't know why it failed either. So my script is like this:
11 Sub try
12
13 Set AConnection = ADO.CreateConnection
14
15 AConnection.ConnectionString = "Provider=SQLNCLI11;data source=xxx-xxx-xxx.xx.xxxx.xxx;initial catalog=xxxxx;integrated security=true;multipleactiveresultsets=true;app=xxxxx;"
16
17 AConnection.Open
18
19
20 AConnection.Close
21
22 End SubBelow is the error details returned:
VBScript runtime error.
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
Error location:
Unit: "E-Academy\E-Academy\Script\WilliamTestScript"
Line: 17 Column: 3.Looks like it was complainting about line 17 - AConnection.Open
Can you please give more instruction how to fix it? BTW, do I have to have SQL server 20xx installed on the machine first in order to run the script? because currently I don't have it nor the Native Client on the machine.
Thanks!
- AlexKaras6 years agoChampion Level 3
Hi,
Does the same error occur if you remove 'multipleactiveresultsets=true;' from the connection string?
- whuang6 years agoRegular Contributor
Hi AlexKaras I think I still need your help regarding this. Now I can setup the SQL connection, but when I tried to execute the query below, it returned me another error: "Object doesn't support named arguments: DBConnection.CommandText".
Set DBConnection = ADO.CreateConnection
DBConnection.ConnectionString = "Provider=xxxx;Integrated Security=xxxx;Persist Security Info=False;User ID=xxxx;Initial Catalog=xxxx;Data Source=xxxx"
DBConnection.OpenDBConnection.CommandText = "My Query to Run"
DBConnection.Execute()DBConnection.Close
Related Content
- 2 years ago
- 6 years ago
- 12 years ago
Recent Discussions
- 10 hours ago