“Microsoft.ACE.OLEDB.12.0"提供程序未注册 - 但已注册 [英] 'Microsoft.ACE.OLEDB.12.0' provider is not registered -but it is
问题描述
简短而甜蜜:
- 应用程序可在 x86 机器上运行,但不能在 x64 机器上运行(在 2008 服务器和 Windows 8 上尝试过)
- 已安装 Microsoft Access 数据库引擎 2010(也已安装 Microsoft Office 2007 Access 数据库引擎)
- 未安装 MS Office
- 确认存在 C:Program Files (x86)Common Filesmicrosoft sharedOFFICE12ACEOLEDB.DLL
代码:
string conn = "Provider=SQLOLEDB;Data Source=localhost;Initial Catalog=Northwind;Integrated Security=SSPI;";
OleDbConnection _connOle = new OleDbConnection(conn);
有什么想法可以让这个应用程序在 x64 机器上运行吗?谢谢!
Any ideas what I should do to get this app to work on the x64 machines? Thanks!
推荐答案
我能想到两个可以解释您的问题的场景:
I can think of two scenarios that could explain your issue:
您的 C# 项目设置为同时面向 64 位和 32 位平台,并且 64 位计算机仅安装了 32 位版本的 Access 数据库引擎.引用失败,因为程序以 64 位运行,但机器丢失
Your C# project is set to target both 64-bit and 32-bit platforms and the 64-bit machine has only the 32-bit version of the Access Database Engine installed. The reference fails because the program is running as 64-bit but the machine is missing
C:Program FilesCommon FilesMicrosoft SharedOFFICE14ACEOLEDB.DLL
C:Program FilesCommon FilesMicrosoft SharedOFFICE14ACEOLEDB.DLL
您的 C# 项目设置为仅面向 32 位平台 (x86),并且 64 位计算机仅安装了 64 位版本的 Access 数据库引擎.引用失败,因为程序以 32 位运行,但机器丢失
Your C# project is set to target 32-bit platforms only (x86) and the 64-bit machine has only the 64-bit version of the Access Database Engine installed. The reference fails because the program is running as 32-bit but the machine is missing
C:Program Files (x86)Common Filesmicrosoft sharedOFFICE14ACEOLEDB.DLL
C:Program Files (x86)Common Filesmicrosoft sharedOFFICE14ACEOLEDB.DLL
请注意,Access 数据库引擎 64 位版本的安装程序仅安装 64 位版本,而不是两者.
Note that the installer for the 64-bit version of the Access Database Engine installs just the 64-bit version, not both.
这篇关于“Microsoft.ACE.OLEDB.12.0"提供程序未注册 - 但已注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!