将连接字符串从Microsoft.Jet.OLEDB.4.0转换为Microsoft.ACE.OLEDB.12.0提供程序

时间:2022-09-27 12:27:45

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.

我正在使用一个.NET程序,在将来的某个时候将是64位编译,其中Microsoft.Jet.OLEDB.4.0将无法正常工作。

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

我正在尝试转换这个看起来像这样的Microsoft.Jet.OLEDB.4.0连接字符串:

"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:

到看起来像这样的Microsoft.ACE.OLEDB.12.0:

"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.

任何人都知道如何正确转换这个连接字符串,以便它是有效的?我不知道有关Microsoft.ACE.OLEDB.12.0连接字符串参数的文档。

1 个解决方案

#1


0  

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

这是我用于Microsoft.ACE.OLEDB.12.0的ConnectionString,它工作正常。

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

提供商= Microsoft.ACE.OLEDB.12.0; Data Source =“$ LOCALAPPDATA $ \ Path \ database.mdb”;坚持安全信息=真; Jet OLEDB:数据库密码= $ PASSWORD $

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

我在ConnectionString中可以看到的唯一区别是指定系统数据库。也许那个数据库也有密码?

#1


0  

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

这是我用于Microsoft.ACE.OLEDB.12.0的ConnectionString,它工作正常。

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

提供商= Microsoft.ACE.OLEDB.12.0; Data Source =“$ LOCALAPPDATA $ \ Path \ database.mdb”;坚持安全信息=真; Jet OLEDB:数据库密码= $ PASSWORD $

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

我在ConnectionString中可以看到的唯一区别是指定系统数据库。也许那个数据库也有密码?