简体   繁体   English

'Microsoft.ACE.OLEDB.12.0' 提供程序未在本地计算机(服务器)上注册

[英]The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine (server)

I know that is this question has dozen of answers and posts, but nothing works for me.我知道这个问题有很多答案和帖子,但对我来说没有任何用处。

I have my MVC 5 application and I deploy it to the IIS 7.5 to my server.我有我的 MVC 5 应用程序,我将它部署到 IIS 7.5 到我的服务器。 Application runs great, everything is works until I go to the Action, where I use ACE.OLEDB.应用程序运行良好,一切正常,直到我 go 到我使用 ACE.OLEDB 的操作。

I'm getting this error:我收到此错误:

[InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.]
System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper) +1785474
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +1802032
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +100
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) +61
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +964
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +6785863
System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +27
System.Data.OleDb.OleDbConnection.Open() +47
QuickbookUploadFromElite3e.Controllers.HomeController.Matters(String filePath) in c:\Users\alex.chakhau\Documents\Visual Studio 2013\Projects\QuickbookUploadFromElite3e\QuickbookUploadFromElite3e\Controllers\HomeController.cs:75
lambda_method(Closure , ControllerBase , Object[] ) +127
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +242
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
System.Web.Mvc.Async.AsyncControllerActionInvoker.<BeginInvokeSynchronousActionMethod>b__36(IAsyncResult asyncResult, ActionInvocation innerInvokeState) +12
System.Web.Mvc.Async.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult) +139
System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3c() +112
System.Web.Mvc.Async.<>c__DisplayClass45.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3e() +452
System.Web.Mvc.Async.<>c__DisplayClass30.<BeginInvokeActionMethodWithFilters>b__2f(IAsyncResult asyncResult) +15
System.Web.Mvc.Async.<>c__DisplayClass28.<BeginInvokeAction>b__19() +37
System.Web.Mvc.Async.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(IAsyncResult asyncResult) +241
System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19
System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(IAsyncResult asyncResult, ProcessRequestState innerState) +51
System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

I found a couple answers on the web and I did the following:我在 web 上找到了几个答案,并执行了以下操作:

  1. Installing Microsoft Access Database Engine 2010 Redistributable安装Microsoft Access 数据库引擎 2010 Redistributable
  2. Installing2007 Office System Driver: Data Connectivity Components安装2007 Office System 驱动程序:数据连接组件

I've tried this:我试过这个:

  1. From the solution explorer right-click your project then click Properties在解决方案资源管理器中右键单击您的项目,然后单击“属性”
  2. Click the Build tab单击构建选项卡
  3. Change Platform target from: Any CPU to x86 |将平台目标从:任何 CPU 更改为 x86 | Any CPU to x64任何 CPU 到 x64
  4. Re-build your solution重新构建您的解决方案

Any suggestions?有什么建议么?

It's probably a bitness issue, but it's not about the bitness in your Build properties.这可能是一个位数问题,但这与您的 Build 属性中的位数无关。

The ACE driver is available in two versions: x86 and x64. ACE 驱动程序有两个版本:x86 和 x64。

  1. You can only install one of them.您只能安装其中之一。
  2. If you install the x86 version, only x86 applications can use it.如果安装 x86 版本,则只有 x86 应用程序可以使用它。 If you install the x64 version, only x64 applications can use it.如果安装 x64 版本,则只有 x64 应用程序可以使用它。 (Yes, it's stupid.) (是的,这很愚蠢。)

Now, whether your web application runs in x86 (32-bit) or x64 mode is not determined by your build settings but by the settings of your application pool : Select the application pool in IIS Manager, go to Properties/Advanced Settings and verify the setting of Enable 32-bit Applications .现在,您的 Web 应用程序是在 x86(32 位)还是 x64 模式下运行不是由您的构建设置决定,而是由您的应用程序池设置决定:在 IIS 管理器中选择应用程序池,转到属性/高级设置并验证启用 32 位应用程序的设置 If it is set, your application runs in x86 mode, otherwise in x64 mode.如果已设置,则您的应用程序以 x86 模式运行,否则以 x64 模式运行。 Make sure it is the same mode as the one of which you installed the ACE driver.确保它与您安装 ACE 驱动程序的模式相同。

(Of course, Steve's answer about using the right driver name also applies.) (当然,史蒂夫关于使用正确驱动程序名称的回答也适用。)

There is no没有

Microsoft.ACE.OLEDB.4.0

There is

Microsoft.ACE.OLEDB.12.0 

or

Microsoft.JET.OLEDB.4.0

Of course the usual rules about 32bit and 64bit should be applied carefully当然,关于 32bit 和 64bit 的通常规则应该小心应用

See this answer 看到这个答案

So you need to install the Access Database Engine redistributable that you can download from here .因此,您需要安装可 从此处下载的 Access 数据库引擎可再发行组件。 But you should be careful to download the correct version (32bit or 64bit) depending on the Target Platform choosen to build your app.但是您应该小心下载正确的版本(32 位或 64 位),具体取决于选择构建您的应用程序的目标平台。 (AnyCPU, x64, x86). (任何CPU、x64、x86)。

Of course, if your server has Office installed then you have already the ACE installed, but it could be for a different platform and your application need to be compiled for the same.当然,如果您的服务器安装了 Office,那么您已经安装了 ACE,但它可能适用于不同的平台,并且您的应用程序需要针对相同的平台进行编译。 (Example, Office 32bit then ACE 32bit and you need to compile your app for x86) (例如,Office 32bit 然后是 ACE 32bit,您需要为 x86 编译您的应用程序)

probably it is X86 or X64 issue可能是 X86 或 X64 问题

you need to install it:你需要安装它:

2007 Office System Driver: Data Connectivity Components.( http://www.microsoft.com/en-us/download/details.aspx?id=23734 ) 2007 办公系统驱动程序:数据连接组件。( http://www.microsoft.com/en-us/download/details.aspx?id=23734

then make sure:然后确保:

BUILD -> Configuration Manager -> Active Solution Platform -> x64 http://www.codeproject.com/Tips/417397/OLEDB-Provider-is-Not-Registered-on-the-Local-Mach构建 -> 配置管理器 -> 主动解决方案平台 -> x64 http://www.codeproject.com/Tips/417397/OLEDB-Provider-is-Not-Registered-on-the-Local-Mach

You have to just change the Configuration manager.您只需更改配置管理器。

Steps:步骤:

  1. Right click on your project name in Solution Explorer.在解决方案资源管理器中右键单击您的项目名称。
  2. Choose configuration manager.选择配置管理器。
  3. Once dialog box open, change Active solution platform as new....对话框打开后,将活动解决方案平台更改为新....
  4. Again once dialog box open, choose x86 CPU.再次打开对话框,选择x86 CPU。
  5. Click OK and close Configuration Manager.单击确定并关闭配置管理器。
  6. Finally, run your project.最后,运行您的项目。

It might look like you have ACE Drivers installed and even changing the Application Pool properties would make the application work.看起来您已经安装了 ACE 驱动程序,甚至更改应用程序池属性也会使应用程序工作。

But you might be missing the Connectivity Driver for your system但是您可能缺少系统的连接驱动程序

Try and install it from this link, it worked for me:尝试从此链接安装它,它对我有用:

https://download.cnet.com/2007-Office-System-Driver-Data-Connectivity-Components/3000-10254_4-75452798.html https://download.cnet.com/2007-Office-System-Driver-Data-Connectivity-Components/3000-10254_4-75452798.html

--- after trying to download the Microsoft Access DataEngine and more --- 在尝试下载 Microsoft Access DataEngine 等之后

I fix this issue by changing the application poll setting for the application >> enable 32-bit applications ( true) >> and restarting the application.我通过更改应用程序的应用程序轮询设置 >> 启用 32 位应用程序 (true) >> 并重新启动应用程序来解决此问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未在本地计算机上注册“ Provider = Microsoft.ACE.OLEDB.12.0”提供程序 - The 'Provider=Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine microsoft.ace.oledb.12.0提供程序未在本地计算机上注册 - the microsoft.ace.oledb.12.0 provider is not registered on the local machine “&#39;Microsoft.ACE.OLEDB.12.0&#39; 提供程序未在本地计算机上注册” - "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine" 'Microsoft.ACE.OLEDB.12.0' 提供程序未在本地计算机上注册 - The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine “Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册。 - The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. 错误:“ Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册” - Error: 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine' Microsoft.ACE.OLEDB.12.0提供程序未在本地计算机上注册? - Microsoft.ACE.OLEDB.12.0 Provider is not registered on the Local Machine? microsoft.ace.oledb.12.0 provider未在本地注册 - microsoft.ace.oledb.12.0 provider is not registered on the local machine Azure-&#39;Microsoft.ACE.OleDb.12.0&#39;提供程序未在本地计算机上注册 - Azure - 'Microsoft.ACE.OleDb.12.0' provider is not registered on the local machine Microsoft.ACE.OLEDB.12.0&#39;提供程序未在本地计算机上注册错误 - Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM