Microsoft.Jet.OLEDB.4.0 - 无法找到提供程序或可能未安装提供程序

时间:2022-09-27 13:49:23

I have created an Excel Macro in which I have used Microsoft.Jet.OLEDB.4.0 to fire query on Excel work sheets.

我创建了一个Excel宏,其中我使用Microsoft.Jet.OLEDB.4.0在Excel工作表上触发查询。

It's working perfect on my machine but my client is facing issue with it. (see the attached screen print)

它在我的机器上工作得很好,但我的客户面临着问题。 (参见随附的屏幕打印)

Microsoft.Jet.OLEDB.4.0  - 无法找到提供程序或可能未安装提供程序

Microsoft.Jet.OLEDB.4.0  - 无法找到提供程序或可能未安装提供程序

Here are details for my Connection Object:

以下是我的连接对象的详细信息:

Dim cn
Set cn = CreateObject("ADODB.Connection")
With cn
    .Provider = "Microsoft.Jet.OLEDB.4.0"
    .ConnectionString = "Data Source=" & ThisWorkbook.FullName & "; Extended Properties=Excel 8.0"
    .Open
End With

Please Note: It is must for me to make the code working in "Windows 7"

请注意:我必须使代码在“Windows 7”中运行

1 个解决方案

#1


10  

The provider will fail like that on Window 7 Office x64 as the provider isn't supported on that platform.

提供程序将在Window 7 Office x64上失败,因为该平台不支持该提供程序。

You need to install the x64 Microsoft Access Database Engine 2010 Redistributable and change your connection string to Provider=Microsoft.ACE.OLEDB.12.0

您需要安装x64 Microsoft Access数据库引擎2010 Redistributable并将您的连接字符串更改为Provider = Microsoft.ACE.OLEDB.12.0

#1


10  

The provider will fail like that on Window 7 Office x64 as the provider isn't supported on that platform.

提供程序将在Window 7 Office x64上失败,因为该平台不支持该提供程序。

You need to install the x64 Microsoft Access Database Engine 2010 Redistributable and change your connection string to Provider=Microsoft.ACE.OLEDB.12.0

您需要安装x64 Microsoft Access数据库引擎2010 Redistributable并将您的连接字符串更改为Provider = Microsoft.ACE.OLEDB.12.0