“Microsoft.ACE.OLEDB.12.0”提供程序未在64位计算机上的本地计算机上注册

时间:2012-06-18 07:40:05

标签: c# windows

我在Windows应用程序中工作。我正在从Excel读取值并更新到数据库中。 我的代码是

 string Con_Str = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filepath +
                         ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=1\";";

它在我的本地工作正常,我有32位机器。我在64位机器的服务器上运行了exe。在那里我得到像

这样的错误
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

我已从此链接下载了最新内容..

http://www.microsoft.com/en-us/download/details.aspx?id=13255

我仍然得到了这个问题。如何解决这个问题..

1 个答案:

答案 0 :(得分:2)

您正在使用Microsoft.ACE.OLEDB.12.0;(简称ADE)。这意味着您需要在目标计算机上安装适当的位。在构建应用程序时,架构选择很复杂。

您为AnyCPU构建:

Install ADE 32bit on 32bit target machine
Install ADE 64bit on 64bit target machine

您为x86构建

Install ADE 32bit on 32bit or 64bit target machine.

如您所见,最简单的方法是编译x86架构的应用程序。

相关问题