在哪里/如何下载(和安装)适用于 Windows 8、64 位的 Microsoft.Jet.OLEDB.4.0?适用于、如何下载、Windows、OLEDB

2023-09-06 05:48:26 作者:蝶衣

我有一个使用 Jet OLEDB 4.0 的 32 位 .net 2.0 应用程序.

I've got a 32 bit .net 2.0 app that uses the Jet OLEDB 4.0.

它在 Windows 8 32 位上运行 fin,但在 64 位上不运行.在 64 位上出现错误:

It runs fin on Windows 8 32 bit, but not on the 64 bit. on 64 bit I'm getting an error:

Microsoft.Jet.OLEDB.4.0"提供程序未在本地注册机器.在System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionStringconstr, DataSourceWrapper&datasrcWrapper)

'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine. at System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper)

我知道您不能将该数据库(驱动程序)与 64 位 EXE 一起使用.但是我没有读到任何关于它不能与 32 位 exe 一起使用的信息.

I am aware that you can't use that database (driver) with a 64 bit EXE. However I've not read anything about it not working with the 32 bit exe.

我尝试了什么:

安装了 MS Access 数据库引擎 2010 32 位(并重新启动)验证msjet40.dll在C:WindowsSysWOW64msjet40.dll"目录下,并用RegSvr32注册.

所以我认为(希望)如果我可以安装数据库支持,它就会正常工作.

So I think (hope) that if I can install the database support it'll just work.

问题是,我找不到下载的地方.

Problem is, I can't find any place to download it.

推荐答案

在现代 Windows 上,此驱动程序默认不再可用,但您可以下载为 Microsoft Access Database Engine 2010 Redistributable 在 MS 站点上.如果您的应用是 32 位,请务必下载并安装 32 位变体,因为据我所知,32 位和 64 位变体不能共存.

On modern Windows this driver isn't available by default anymore, but you can download as Microsoft Access Database Engine 2010 Redistributable on the MS site. If your app is 32 bits be sure to download and install the 32 bits variant because to my knowledge the 32 and 64 bit variant cannot coexist.

根据您的应用程序如何定位其数据库驱动程序,这可能就是所有需要的.但是,如果您使用 UDL 文件,则有一个额外的步骤 - 您需要编辑该文件.不幸的是,在 64 位机器上,用于编辑 UDL 文件的向导默认是 64 位的,它不会看到 JET 驱动程序,只会拍打它首先在 UDL 文件中找到的任何驱动程序.有两种方法可以解决这个问题:

Depending on how your app locates its db driver, that might be all that's needed. However, if you use an UDL file there's one extra step - you need to edit that file. Unfortunately, on a 64bits machine the wizard used to edit UDL files is 64 bits by default, it won't see the JET driver and just slap whatever driver it finds first in the UDL file. There are 2 ways to solve this issue:

像这样启动 32 位 UDL 向导:C:Windowssyswow64undll32.exe "C:Program Files (x86)Common FilesSystemOle DBoledb32.dll",OpenDSLFile C:path oyour.udl.请注意,我可以在 Win7 64 Pro 上使用这种技术,但它在 Server 2008R2 上不起作用(可能是我的错误,只是提一下)在记事本或其他文本编辑器中打开 UDL 文件,它应该或多或少具有以下格式: start the 32 bits UDL wizard like this: C:Windowssyswow64undll32.exe "C:Program Files (x86)Common FilesSystemOle DBoledb32.dll",OpenDSLFile C:path oyour.udl. Note that I could use this technique on a Win7 64 Pro, but it didn't work on a Server 2008R2 (could be my mistake, just mentioning) open the UDL file in Notepad or another text editor, it should more or less have this format:

[oledb];此行之后的所有内容都是 OLE DB 初始化字符串Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:PathToThedatabase.mdb;Persist Security Info=False

这应该可以让您的应用正确启动.

That should allow your app to start correctly.