The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,421 other followers

Solution for OLE DB provider connecting to SQL Server giving error “Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done”

Posted by jpluimers on 2010/10/19

Recently, I had the error message “Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done” occur to me when connecting through the “Microsoft OLE DB Provider for SQL Server”.

I got the below message (in this case in Delphi, but I have seen lots of other people having the same issue using other environments too):

—————————
Error
—————————
Error connecting to the database!
Database name: “Provider=”SQLOLEDB.1″;Persist Security Info=”False”;Integrated Security=”True”;Initial Catalog=”MyDatabase”;Data Source=”.\SQLEXPRESS””
Class: EOleException
Message: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done
Source: Provider
HelpFile:

—————————
OK
—————————

In fact though the ADO.NET provider for SQL Server documentation indicates that for “Integrated Security“, the value true is equivalent for SSPI, for OLE DB this is not the case.
So:
When using the Microsoft OLE DB Provider for SQL Server (aka SQLODEDB.1), and you use Integrated Security, make sure you specify SSPI as the value.

Bad connection string:

Provider=SQLOLEDB.1;Integrated Security=True;Persist Security Info=False;Initial Catalog=MyDatabase;Data Source=.\SQLEXPRESS

Good connection string:

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyDatabase;Data Source=.\SQLEXPRESS

Hope this helps a few people.

–jeroen

5 Responses to “Solution for OLE DB provider connecting to SQL Server giving error “Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done””

  1. megha said

    hello i am getting the same error but i am using ms access as my database..
    Pls help..

  2. José Pablo said

    I have the same problem using visual basic 6.0, when I use integrated security = SSPI all works fine, but I need use a specify user for this work, and I need use integrated security =”false”, with that I get this error

    Can anyone help?

    • jpluimers said

      Not sure, as I don’t use VB6.

      In .NET it works if you set Integrated Security=false and give Password and User ID a proper value.

  3. Frankie Espinoza said

    Hi dude,
    i read your blog,This is a wonderful blog.I was able to get the
    information that I had been looking for.
    Thanks once again.
    http://frankieespinoza.weebly.com/delphi-consulting.html

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: