Matthew Findlater
Matthew Findlater

Reputation: 11

Converting connection string from Microsoft.Jet.OLEDB.4.0 to Microsoft.ACE.OLEDB.12.0 provider

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.

Upvotes: 1

Views: 2821

Answers (1)

dub stylee
dub stylee

Reputation: 3342

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?

Upvotes: 0

Related Questions