简体   繁体   English

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

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

every thing work fine locally but this error occurs when I publish it:在本地一切正常,但在我发布时出现此错误:

 The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

and stack trace和堆栈跟踪

[InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.]
System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper) +1027372
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +337
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +86
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) +31
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +76
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +126
System.Data.OleDb.OleDbConnection.Open() +43
System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +123
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +319
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +92
System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1618
System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +97
System.Web.UI.WebControls.ListControl.PerformSelect() +34
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
System.Web.UI.WebControls.ListControl.OnPreRender(EventArgs e) +29
System.Web.UI.Control.PreRenderRecursiveInternal() +103
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Control.PreRenderRecursiveInternal() +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496

I am using MS access 2007 database and this my connection string within web.config我正在使用 MS access 2007 数据库,这是我在 web.config 中的连接字符串

        <add name="ConnectionString" connectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\OmanLegalDB.accdb;Persist Security Info=True" providerName="System.Data.OleDb"/>

any suggestions for this problem对这个问题的任何建议

For version 12.0 you need to install MDAC 2010 from here .对于 12.0 版,您需要从 此处安装 MDAC 2010。

This has to be done on the server where you publish your application.这必须在您发布应用程序的服务器上完成。 You need to install the x86 version if the target machine is 32 bit or the x64 version if the target machine is 64 bit and your application is built with configuration Any CPU .如果目标机器是 32 位,则需要安装 x86 版本;如果目标机器是 64 位,则需要安装 x64 版本,并且您的应用程序是使用Any CPU配置构建的。

As suggested in here You need to change the Solution Platform from " Any CPU " to " x86 ".如此处所建议您需要将解决方案平台从“任何 CPU ”更改为“ x86 ”。

Your connection string is right so this error could be caused by following reason:您的连接字符串是正确的,所以这个错误可能是由以下原因引起的:

  • If your Office is 32 bit on a 64bit machine and MDAC driver installed is 64bit.如果您的 Office 在 64 位机器上是 32 位的并且安装的 MDAC 驱动程序是 64 位的。 In this case you would need to install 32bit MDAC driver to match 32bit Office binaries.在这种情况下,您需要安装 32 位 MDAC 驱动程序以匹配 32 位 Office 二进制文件。

This post has detailed info on how to troubleshoot it.这篇文章有关于如何解决它的详细信息。

If you don't want to download anymore add on's another fix I've found is changing ACE to JET and 12 to 4.如果您不想再下载,请添加我发现的另一个修复程序,将 ACE 更改为 JET,将 12 更改为 4。

'Microsoft.JET.OLEDB.4.0'

You then also need to make sure that you change the database from.accdb to.mdb format and that should work.然后,您还需要确保将数据库格式从 .accdb 更改为 .mdb,这样应该可以正常工作。

暂无
暂无

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

相关问题 ''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;提供程序的在线错误。” - online error of “The 'Microsoft.ACE.oledb.12.0' provider is not registered on the local machine.” “ Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册。 C# - The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. c# System.InvalidOperationException:&#39;Microsoft.ACE.OLEDB.12.0&#39; 提供程序未在本地计算机上注册。&#39; - System.InvalidOperationException: 'The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.' 一些有关“ Microsoft.ACE.OLEDB.12.0”提供程序未在本地计算机上注册的问题。 - Some issue about “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. Error 未在本地计算机上注册“ 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
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM