read this<BR><BR><BR><BR>PRB: "Multiple-step OLE DB operation generated errors" When Opening ADO Connection <BR><BR>Q269495<BR><BR><BR>--------------------------------------------------------------------------------<BR>The information in this article applies to:<BR><BR>ActiveX Data Objects (ADO), versions 2.0, 2.1, 2.5, 2.6<BR><BR>--------------------------------------------------------------------------------<BR><BR><BR>SYMPTOMS<BR>While attempting to open an ActiveX Data Objects (ADO) connection, the following error may occur: <BR><BR><BR>Run-time error &#039;-2147217887 (80040e21):&#039;<BR><BR>Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. <BR><BR><BR><BR>CAUSE<BR>The following are two possible causes of this error: <BR><BR>In the registry, under the key for an OLE DB provider&#039;s CLSID, there may be an entry named OLEDB_SERVICES. If the OLE DB provider being used to make the ADO connection doesn&#039;t have the OLEDB_SERVICES entry, and ADO tries to set up a property that is not supported by the provider, the error occurs. For more information on this registry entry, see the "Resolution" section.<BR><BR><BR>If OLEDB_SERVICES entry exists but there is a problem in the ADO connection string, the error occurs.<BR><BR><BR>If the OLEDB_SERVICES registry entry is not present, the call to set up a property is made directly to the provider. If the provider does not support the property, the SetProperties OLE DB call made by ADO will fail. This is a fatal failure if the property is required in order to make a connection. If the property was explicitly included in the connection string, it is most likely required.<BR><BR>If the property setting is optional, the failure is not fatal. This is the case when you connect without explicitly setting the property in the connection string. In this case, ADO sets the property to True but marks it as optional. <BR><BR><BR><BR>RESOLUTION<BR>You can work around this problem in the following ways: <BR><BR>Do not use the "Persist Security Info" keyword in your ADO connection string.<BR><BR><BR>Add the OLEDB_SERVICES registry entry as follows:<BR><BR>IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.<BR><BR><BR>Start Registry Editor (Regedit.exe).<BR><BR><BR>In the registry under HKEY_CLASSES_ROOTCLSID, find the CLSID of the OLE DB Provider. For example, the following registry key is for the Microsoft OLE DB Provider for SQL Server (SQLOLEDB): <BR>HKEY_CLASSES_ROOTCLSID{0C7FF16C-38E3-11d0-97AB-00C04FC2AD98}<BR>Click the CLSID, and then on the Edit menu, click Add Value and add the following registry value:<BR><BR><BR>Value Name: OLEDB_SERVICES<BR>Data Type: REG_DWORD<BR>Value: 0xFFFFFFFF<BR><BR>NOTE: To find the CLSID for the provider you are using, search for the provider&#039;s ProgID (SQLOLEDB, for example) in the registry under HKEY_LOCAL_MACHINESOFTWAREClasses. Under the ProgID, there will be a key named CLSID.<BR><BR><BR>If the above conditions are satisfied and you still receive the error, check your connection string for other possible errors.<BR><BR><BR><BR><BR><BR>MORE INFORMATION<BR><BR>Steps to Reproduce Behavior<BR>Paste the following code in a Microsoft Visual Basic Standard EXE project, set a Project Reference to Microsoft ActiveX Data Objects, and then run it. The error occurs if you use the DTSFlatFile provider or any OLE DB provider that does not support one of the properties in the connection string, such as "Persist Security Info". <BR><BR>Private Sub Command1_Click()<BR><BR>Dim cn As New Connection<BR><BR>cn.Open "Provider=DTSFlatFile;Persist Security Info=True;" & _<BR> "Data Source=Mysql;Mode=Read;File Format=0;File Type=1;" & _<BR> "Skip Rows=0;First Row Column Name=False;Number of Column=0;" & _<BR> "Max characters per delimited column=255;" &#039;&#060;------ Error Occurs Here<BR> <BR>End Sub <BR><BR><BR><BR>REFERENCES<BR>For additional information on this error, click the article numbers below to view the articles in the Microsoft Knowledge Base: <BR><BR>Q228935 FIX: Uninitialized String Variables, Empty String Values, Jet Provider, and Errors Occurred <BR>Q253157 BUG: Identity Field Remains Read-Only After Executing SET IDENTITY_INSERT ON Statement <BR><BR>Additional query words: <BR><BR>Keywords : kbADO kbMDAC kbOLEDB kbProvider kbGrpVCDB kbGrpMDAC kbDSupport <BR>Issue type : kbprb <BR>Technology : kbAudDeveloper kbADOsearch <BR><BR><BR>Last Reviewed: December 4, 2000<BR>© 2001 Microsoft Corporation. All rights reserved. Terms of Use.<BR> <BR><BR><BR><BR>--------------------------------------------------------------------------------<BR>Send feedback to MSDN.Look here for MSDN Online resources.