1
votes

I am working with a .NET program that will at some point in the future be 64-bit compiled where Microsoft.Jet.OLEDB.4.0 will not work.

I'm trying to convert this Microsoft.Jet.OLEDB.4.0 connectionstring that looks like this:

"Provider=Microsoft.Jet.OLEDB.4.0;OLE DB Services=-4;Password=<PASSWORD>;User ID=<USERID>;Data Source=<ACCESSDATABASE>.MDB;Persist Security Info=True;Jet OLEDB:System database=<SYSTEMDB>.mdw"

to a Microsoft.ACE.OLEDB.12.0 that looks something like:

"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=<ACCESSDATABASE>.mdb;Jet OLEDB:Database Password=<PASSWORD>;Jet OLEDB:System database=<SYSTEMDB>.mdw;Persist Security Info=False"

Whenever I try to connect with this new connectionstring I get this exception:

System.Data.OleDb.OleDbException (0x80040E4D): Not a valid account name or password.

Anyone know how to properly convert this connectionstring so that it's valid? There is no documentation on Microsoft.ACE.OLEDB.12.0 connection string parameters that I know of.

1
I just noticed after posting my answer below, you may need quotes around your Data Source if it contains spaces.dub stylee
Did you ever find a solution to this problem?Valerio Santinelli

1 Answers

0
votes

Here is my ConnectionString that I use for Microsoft.ACE.OLEDB.12.0 and it works fine.

Provider=Microsoft.ACE.OLEDB.12.0; Data Source="$LOCALAPPDATA$\Path\database.mdb"; Persist Security Info=True; Jet OLEDB:Database Password=$PASSWORD$

The only difference I can see in your ConnectionString is the specifying the system database. Maybe that database also has a password?