What is this 'Multiple-step OLE DB' error?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 18:53:45

问题


I'm doing a little bit of work on a horrid piece of software built by Bangalores best.

It's written in mostly classic ASP/VbScript, but "ported" to ASP.NET, though most of the code is classic ASP style in the ASPX pages :(

I'm getting this message when it tries to connect to my local database:

Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

Line 38:    MasterConn = New ADODB.Connection()
Line 39:    MasterConn.connectiontimeout = 10000
Line 40:        MasterConn.Open(strDB)

Anybody have a clue what this error means? Its connecting to my local machine (running SQLEXPRESS) using this connection string:

PROVIDER=MSDASQL;DRIVER={SQL Server};Server=JONATHAN-PC\SQLEXPRESS\;DATABASE=NetTraining;Integrated Security=true

Which is the connection string that it was initially using, I just repointed it at my database.

UPDATE:

The issue was using "Integrated Security" with ADO. I changed to using a user account and it connected just fine.


回答1:


I ran into this a long time ago with working in ASP. I found this knowledge base article and it helped me out. I hope it solves your problem.

http://support.microsoft.com/kb/269495

If this doesn't work and everything checks out, then it is probably your connection string. I would try these steps next:

Remove:

DRIVER={SQL Server};

Edit the Provider to this:

Provider=SQLOLEDB;



回答2:


As a side note, connectionstrings.com is a great site so you don't have to remember all that connection string syntax.




回答3:


I came across this problem when trying to connect to an MySQL database via the wonderful Classic ASP. The solutions above didn't fix it directly, but I resolved it in the end by updating the ODBC Driver (from the long standing 3.51) to the latest version. I was then able to leave the driver line in (and not add the Provider bit), but I did have to update the connection string accordingly to:

Driver={MySQL ODBC 5.1 Driver};

That worked fine. Happy chappy.



来源:https://stackoverflow.com/questions/24730/what-is-this-multiple-step-ole-db-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!