未在本地计算机上注册"Microsoft.ACE.OLEDB.14.0"提供程序 [英] The 'Microsoft.ACE.OLEDB.14.0' provider is not registered on the local machine

查看:1182
本文介绍了未在本地计算机上注册"Microsoft.ACE.OLEDB.14.0"提供程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建了一个小型WPF应用程序,它将读取XLS或XLSX文件并在datagrid中显示内容.通过使用Microsoft.Jet.OLEDB.4.0提供程序,XLS方面的工作正常.我正在努力处理XLSX方面的问题.我正在运行Windows 7(64位),并且在计算机上安装了Office 2010(64位).我在ODBC连接中看到了OLEDB的版本14和12.当我运行连接字符串时,它将返回错误.我已经阅读了许多帖子,但都没有任何成功的答案,很多都指向了该应用程序正在运行的x86版本.我已经尝试过14.0和12.0在各自的版本号上得到相同的错误.

I have built a small WPF app that will read in XLS or XLSX files and display the contents in a datagrid. I have the XLS side of things working by using the Microsoft.Jet.OLEDB.4.0 provider. I am struggling with the XLSX side of things. I am running Windows 7 (64-bit) and have Office 2010 (64-bit) installed on my machine. I see the version 14 and 12 versions of the OLEDB in my ODBC connections. When I run my connection string it returns an error. I have read through many of the posts without any successful answers, many pointing to the version the app is running which is x86. I have tried both 14.0 and 12.0 getting the same error with respective version numbers.

连接字符串:
Provider = Microsoft.ACE.OLEDB.14.0;数据源= C:\ Users \ xxxxx \ Desktop \ test.xlsx;扩展属性= \"Excel 14.0; HDR =是; IMEX = 1 \"

Connection String:
Provider=Microsoft.ACE.OLEDB.14.0;Data Source=C:\Users\xxxxx\Desktop\test.xlsx;Extended Properties=\"Excel 14.0;HDR=Yes;IMEX=1\"

代码:

using (OleDbConnection connection = new OleDbConnection(GetConnectionString()))
{
    connection.Open();
}

错误:
未在本地计算机上注册"Microsoft.ACE.OLEDB.14.0"提供程序.

Error:
The 'Microsoft.ACE.OLEDB.14.0' provider is not registered on the local machine.

推荐答案

根据我已经准备好尝试解决的问题,您最终可能会在x64机器上获得针对32位和64位注册的不同驱动程序.

From what I've ready trying to deal with this, you can end up with different drivers registered for 32-bit and 64-bit on an x64 machine.

我所看到的最清晰的例子是从您的开始菜单中搜索ODBC管理,并在您添加新的DSN时比较32位和64位列表

The clearest example I've seen of demonstrating this is searching for ODBC administration from your start menu, and comparing the 32-bit and 64-bit lists when yo ugo to add a new DSN

这篇关于未在本地计算机上注册"Microsoft.ACE.OLEDB.14.0"提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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