OLE DB multi-step operations caused errors. Check each OLE DB status value, if available. There was no work

I run the following code

/*Fetchinch Last CustID from custMaster*/
int ID=0;
try
{
     con.Open();
     da = new OleDbDataAdapter("select max(Id) from custMaster",con);
     DataSet ds = new DataSet();
     da.Fill(ds);
     for(int i=0;i<ds.Tables[0].Rows.Count;i++)
     ID=int.Parse(ds.Tables[0].Rows[i][0].ToString());
     con.Close();
}
catch (Exception ex) {}
finally 
{
     con.Close();
}

I place a debugger from the first statement of a try block and find that an error occurs when I try to open a connection. Error text:

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

Connection string:

"Provider = Microsoft.Jet.OLEDB.4.0; DataSource = E: \ NewSoft \ Database \ TestApp.accdb Integrated Security = SSPI"

I am using oledb connections.

+5
source share
4 answers

This may be the result of an error in your connection string. You should try to add

Persist Security Info=True;

OLE DB, OLEDB_SERVICES. HKEY_CLASSES_ROOT\CLSID CLSID OLE DB :

Value Name: OLEDB_SERVICES
Data Type: REG_DWORD
Value: 0xFFFFFFFF

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

+1

:

Data Source=.\SQLEXPRESS;Initial Catalog=master;Integrated Security=True

Integrated Security=True Integrated Security=SSPI .

+3

For a similar problem with the MS Access database, this exact error was generated for the wrong password set in the Jet OLEDB connection attribute : Database password =

+1
source

I had the same problem, but special characters used in the password were detected.

So, I changed the password of the Access file and replaced Jet OLEDB: Database Password = with the updated one, and it solved the problem.

+1
source

All Articles