ms-accessvb6oledboledbconnectionaceoledb

Multiple-step OLE DB operation generated errors" when opening ADO connection


I have this connection string

strConnect = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\mydb.accdr;Persist Security Info=False;"

When I try to open the connection, I get this error:

Multiple-step OLE DB operation generated errors"

when opening ADO connection.
I tried all possible solutions found on Google, but no success. Registry is fine.

Any advice?

Here is how I use the code: (cn is a global ADODB.Connection)

Set cn = New ADODB.Connection
cn.Open strConnect, "Admin", ""

PC is running windows XP with no MS Office installed.

EDIT

I have tested the connection string outside of the application and it works fine. just doesn't want to connect when opening the connection from code.

Also had a look at http://www.adopenstatic.com/faq/80040e21.asp, seems my issue is scenario 2 but still no idea how to fix it.

Other references I looked at, but where not helpful are: https://support.microsoft.com/en-us/kb/269495


Solution

  • Apparently my connection string was the problem, had a property that is not supported. It should be like this:

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\mydb.accdr;
    

    without the Persist Security Info=False; which is not supported.

    Hope somebody finds this helpful.