Microsoft.Jet.OLEDB.4.0 - 无法找到提供程序或可能未安装 [英] Microsoft.Jet.OLEDB.4.0 - Provider can not be found or it may not be installed

查看:1000
本文介绍了Microsoft.Jet.OLEDB.4.0 - 无法找到提供程序或可能未安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



在我的机器上运行正常但我的客户面临着这个问题。 (见附件屏幕)







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

  Dim cn 
设置cn = CreateObject(ADODB.Connection)
带有cn
.Provider =Microsoft.Jet.OLEDB.4.0
.ConnectionString =Data Source =& ; ThisWorkbook.FullName& ;扩展属性= Excel 8.0
.Open
结束

请注意:我必须让代码在Windows 7中运行

解决方案

提供程序将失败,如Window 7平台上不支持Office x64作为提供者。



您需要安装x64 Microsoft Access数据库引擎2010可重新分发,并将连接字符串更改为 Provider = Microsoft.ACE.OLEDB。 12.0


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

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"

解决方案

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

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

这篇关于Microsoft.Jet.OLEDB.4.0 - 无法找到提供程序或可能未安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆