C# Microsoft.Jet.OLEDB.4.0' 提供程序未在本地计算机上注册
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1991643/
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 is not registered on the local machine
提问by neo
I created a windows application developed in .NET 3.5 in a 32 bit Windows 2008 server. When deployed the application in a 64 bit server it shows the error "Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine ".
我在 32 位 Windows 2008 服务器中创建了一个用 .NET 3.5 开发的 Windows 应用程序。在 64 位服务器中部署应用程序时,它显示错误“Microsoft.Jet.OLEDB.4.0' provider 未在本地计算机上注册”。
So as a solution to this issue, i have changed the build property of the project to X86, so that it will build in 32 bit mode, and rebuild the project in the 32bit machine. But, the same project uses other DB drivers (DB2, SQL etc.) to connect to other databases. So when i deployed my app again in the 64 bit OS, it throws the exception " Attempted to load a 64-bit assembly on a 32-bit platform. "
所以为了解决这个问题,我把项目的build属性改成X86,这样它就可以在32位模式下构建,并在32位机器上重建项目。但是,同一个项目使用其他数据库驱动程序(DB2、SQL 等)连接到其他数据库。因此,当我在 64 位操作系统中再次部署我的应用程序时,它抛出异常“尝试在 32 位平台上加载 64 位程序集。”
I am using the Microsoft.Jet.OLEDB.4.0 driver to read and write to the Excel (.xls)
我正在使用 Microsoft.Jet.OLEDB.4.0 驱动程序来读取和写入 Excel (.xls)
采纳答案by neo
I found a solution for this problem. The issue I described in my question occured basically due to the incompatibility of the Microsoft.Jet.OLEDB.4.0 driverin 64 bit OS.
我找到了解决这个问题的方法。我在问题中描述的问题主要是由于64 位操作系统中Microsoft.Jet.OLEDB.4.0 驱动程序的不兼容而发生的。
So if we are using Microsoft.Jet.OLEDB.4.0 driver in a 64 bit server, we have to force our application to build in in 32 bit mode (This is the answer I found when I did an extensive search for this known issue) and that causes other part of my code to break.
因此,如果我们在 64 位服务器中使用 Microsoft.Jet.OLEDB.4.0 驱动程序,我们必须强制我们的应用程序以 32 位模式构建(这是我对这个已知问题进行广泛搜索时找到的答案)这会导致我的代码的其他部分中断。
Fortunately, now Microsoft has released a 64 bit compatible 2010 Office System Driverwhich can be used as replacement for the traditional Microsoft.Jet.OLEDB.4.0 driver. It works both in 32 bit as well as 64 bit servers. I have used it for Excel file manipulation and it worked fine for me in both the environments. But this driver is in BETA.
幸运的是,现在微软已经发布了一个 64 位兼容的2010 Office System Driver,可以替代传统的 Microsoft.Jet.OLEDB.4.0 驱动程序。它适用于 32 位和 64 位服务器。我已经将它用于 Excel 文件操作,并且在这两种环境中对我来说都很好。但是这个驱动程序是在BETA 中。
You can download this driver from Microsoft Access Database Engine 2010 Redistributable
您可以从Microsoft Access Database Engine 2010 Redistributable下载此驱动程序
回答by AnthonyWJones
There isn't a 64 bit provider for Jet. If you want to support multiple DB sources including Jet to Excel you will need at least that part of your application to run in a 32 bit process.
Jet 没有 64 位提供程序。如果您想支持多个数据库源,包括 Jet 到 Excel,您至少需要应用程序的那部分在 32 位进程中运行。
The error you are getting when you compile for x86 is a bit strange. I can't see how you would end up referencing 64 bit assemblies in this case.
为 x86 编译时遇到的错误有点奇怪。在这种情况下,我看不出您最终会如何引用 64 位程序集。
回答by Jason Wicker
If the issue persist in ASP.NET,All I had to do was change the "Enable 32-bit Applications" setting to True, in the Advanced Settings for the Application Pool.
如果问题在 ASP.NET 中仍然存在,我所要做的就是在应用程序池的高级设置中将“启用 32 位应用程序”设置更改为 True。
回答by Kakopappa
I had the same issue. I changed the application configuration to x86
, then it worked!
我遇到过同样的问题。我将应用程序配置更改为x86
,然后就成功了!
回答by leo
I've the same message, I have a webpage with do on visual studio 2010, I read a file.xls on that page,in my project visual has not any problem, when I put it on my IIS local throw me a 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine',I fixed that problem next following this steps,
我有同样的消息,我在 Visual Studio 2010 上有一个带有 do 的网页,我在该页面上读取了一个 file.xls,在我的项目中视觉没有任何问题,当我把它放在我的 IIS 本地时,我给我一个“Microsoft .Jet.OLEDB.4.0' provider 未在本地机器上注册',我按照以下步骤修复了该问题,
1.-Open IIS
2.-Change the appPool on Advanced Settings
3.-true to enable to 32-bit application.
and that's all
1.-打开 IIS 2.-更改高级设置上的 appPool
3.-true 以启用 32 位应用程序。
就这样
ps.I changed Configuration Manager to X86 on Active Solution Platform
ps.我在 Active Solution Platform 上将 Configuration Manager 更改为 X86
回答by Muhamed Shafeeq
I just Changed my Property of project into x64 format
我刚刚将我的项目属性更改为 x64 格式
Project---> Properties--->Build--->Target Framework---> X64
项目---> 属性---> 构建---> 目标框架---> X64
回答by Iqbal
I have the same problem
我也有同样的问题
Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine
Microsoft.Jet.OLEDB.4.0' 提供程序未在本地计算机上注册
I applied the answer by neobut it did not work until I change the provider to “Provider=Microsoft.ACE.OLEDB.12.0;”in connection string.
我应用了neo的答案,但直到我将提供者更改为“Provider=Microsoft.ACE.OLEDB.12.0;”才起作用。在连接字符串中。
Hope this will help if some one face the same issue.
如果有人面临同样的问题,希望这会有所帮助。
回答by dpsrikanth
Change in IIS Settings application pool advanced settings.Enable 32 bit application
更改 IIS 设置应用程序池高级设置。启用 32 位应用程序
回答by Anant Dabhi
There is indeed no 64 bit version of Jet - and no plans (apparently) to produce one.
确实没有 64 位版本的 Jet - 也没有计划(显然)生产一个。
You might be able to use the ACE 64 bit driver: http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=23734
您也许可以使用 ACE 64 位驱动程序:http: //www.microsoft.com/en-us/download/details.aspx?displaylang=en& id=23734
- but I have no idea how that would work if you need to go back to Jet for your 32 bit apps.
- 但我不知道如果您需要为 32 位应用程序返回到 Jet,这将如何工作。
However, you may be able to switch the project to 32bit in the Express version (I haven't tried and don't have 2008 installed in any flavour anymore)
但是,您可能可以在 Express 版本中将项目切换到 32 位(我没有尝试过,也没有再安装任何风格的 2008)
- there is a thread here that talks about it: http://xboxforums.create.msdn.com/forums/t/4377.aspx#22601
Maybe it's time to scrap Access databases altogether, bite the bullet and go for SQL server instead?
也许是时候完全废弃 Access 数据库,硬着头皮转而使用 SQL Server 了?
回答by A Ghazal
I'm using VS2013 for Winforms, the below solution worked for me.
我正在将 VS2013 用于 Winforms,以下解决方案对我有用。
Download : http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=23734
Then Set VS Target Platform to x86.
下载:http: //www.microsoft.com/en-us/download/details.aspx?displaylang=en& id=23734
然后将 VS 目标平台设置为 x86。