多步OLE DB操作产生错误。检查每个OLE DB状态值,如果可用。没有工作已完成状态、错误、操作、工作

由网友(冷〤夜轩)分享简介:我正在下面code /*Fetchinch Last CustID from custMaster*/int ID=0;try{con.Open();da = new OleDbDataAdapter("select max(Id) from custMaster",con);DataSet ds = new...

我正在下面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();
}

我把调试器,try块的第一个语句,并发现当我试图打开连接的错误正在添加。 错误文本:

I am putting debugger from the first statement of try block and finding that error is comming when i am trying to open the connection. Error Text:

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

连接字符串是:

Connection String is:

供应商= Microsoft.Jet.OLEDB.4.0;数据源= E:力新数据库 TestApp.accdb;集成   安全性= SSPI

"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=E:NewSoftDatabaseTestApp.accdb;Integrated Security=SSPI"

我使用OLEDB连接。

I am using oledb connections.

推荐答案

这可以在连接字符串错误的结果。你应该尝试添加

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

Persist Security Info=True;

或者你可能在你的OLE DB提供程序,其中必须有OLEDB_SERVICES记录你的注册表问题。在根据HKEY_CLASSES_ROOT CLSID注册表,查找OLE DB提供程序的CLSID,并添加下面的注册表值:

Or you might have problems in your registry with your OLE DB provider, which must have OLEDB_SERVICES record. In the registry under HKEY_CLASSES_ROOTCLSID, find the CLSID of the OLE DB provider and add the following registry value:

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

请参阅 http://support.microsoft.com/kb/269495 了解更多信息

阅读全文

相关推荐

最新文章