The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
2011-04-08 09:02
483 查看
专案中,需要实现用户上传Excel文件,很久之前,只实现过Excel97-2003版本的文件,现在考虑到用户有可能上传Excel2007或更高版本,两个版本连接有点不一样,可以参考http://www.cnblogs.com/insus/articles/2008946.html 使用.xlsx版本边接语句之后,在run程序时,即出现如下Error:
Exception Details: System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Source Error:
Source File: d:\Projects\WebSite1\A.aspx.cs Line: 23
Stack Trace:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
原因与解决办法,是因为web服务器没有安装 2007 Office System Driver: Data Connectivity Components ,这个组件有x86与x64版本,您可以根据实际情况选择性下载来安装。
下载连接:http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d
Server Error in '/WebSite1' Application.
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
Source Error:
Line 21: Line 22: Line 23: objDa.Fill(objDs); Line 24: this.GridView1.DataSource = objDs.Tables[0]; Line 25: this.GridView1.DataBind(); |
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) +94 A.Page_Load(Object sender, EventArgs e) in d:\Projects\WebSite1\A.aspx.cs:23 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35 System.Web.UI.Control.OnLoad(EventArgs e) +91 System.Web.UI.Control.LoadRecursive() +74 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207 |
原因与解决办法,是因为web服务器没有安装 2007 Office System Driver: Data Connectivity Components ,这个组件有x86与x64版本,您可以根据实际情况选择性下载来安装。
下载连接:http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d
相关文章推荐
- The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
- The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine
- 关于异常“The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine”的处理
- 关于异常“The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine”的处理
- The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local Machine 完美解决
- 关于异常“The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine”的处理
- C#导入excel时报错:The 'Microsoft.Ace.OleDb.12.0' provider is not registered on the local machine
- 关于 The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. 异常处理
- The 'Microsoft.ACE.OLEDB.14.0' provider is not registered on the local machine
- Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine
- Oops, 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine error
- 关于异常“The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine”的处理
- HOW TO: FIX ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine"
- The ‘Microsoft.ACE.OLEDB.12.0′ provider is not registered on the local machine. (System.Data)
- 网站中使用了Excel组件问题 Microsoft.ACE.OLEDB.14.0' provider is not registered on the local machine
- 关于异常“The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine”的处理
- The 'Microsoft.ACE.Oledb.12.0' provider is not registered on the local machine
- 包执行中提示错误:The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
- 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine
- 导入xlsx文件提示:The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine