vba Microsoft.Jet.OLEDB.4.0 - 找不到或可能未安装提供程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12495232/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Microsoft.Jet.OLEDB.4.0 - Provider can not be found or it may not be installed
提问by Tejas
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)
它在我的机器上运行良好,但我的客户遇到了问题。(见附上的丝网印刷)
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”中工作
回答by Alex K.
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 Redistributableand change your connection string to Provider=Microsoft.ACE.OLEDB.12.0
您需要安装 x64 Microsoft Access Database Engine 2010 Redistributable并将连接字符串更改为Provider=Microsoft.ACE.OLEDB.12.0