TearSnow Fan


x64平台上 Microsoft.Jet.Ole.DB.4.0 provider is not registered 错误解决

现象:

在32位开发环境下编译的桌面或者ASP.NET应用程序部署到64位的Windows系统下,如果应用程序使用OleDb去访问Access数据库. 会出现了如下错误信息:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.
at System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper)
at System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection)
at System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at TestCaes_windowsVersion_Thd2046.TestCasesDataSetTableAdapters.TC_HistoricTableAdapter.Fill(TC_HistoricDataTable dataTable) in C:\Users\Pzb\Desktop\TestCases_Windows版\TestCases_Windows版\TestCasesDataSet.Designer.cs:line 20586
at TestCaes_windowsVersion_Thd2046.ViewTestCases.ViewTestCases_Load(Object sender, EventArgs e) in C:\Users\Pzb\Desktop\TestCases_Windows版\TestCases_Windows版\ViewTestCases.cs:line 30
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

解决方法

1、桌面应用程序

打开需要访问Access数据库的项目属性,在“Build”选项卡中,将 Platform Target 改为“x86”即可。

2、ASP.NET 应用程序

在IIS管理器中,找到该站点所对应的应用程序池:

再找到该应用程序池的高级设置:

将”Enable 32 Bit Applications”打开。再将此应用程序池重启一下。发现上述问题就解决了。

Windows 7 / Windows 2008 (R2) 64 bit 操作系统下,ASP.NET 应用程序出现类似错误,可以参考下面的文章:

Windows 2008 / Windows 7 x64: The ‘Microsoft.Jet.OLEDB.4.0′ provider is not registered on the local machine.

单击此处查看本文英文版。

本文固定链接: http://blog.xieyc.com/oledb-4-0-not-registered-on-x64/ | 小谢的小站

该日志由 xieyc 于2013年05月09日发表在 编程 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: x64平台上 Microsoft.Jet.Ole.DB.4.0 provider is not registered 错误解决 | 小谢的小站
关键字: , , , , ,

目前共有 0 条留言 【 访客:0 条, 博主:0 条 】暂时没有评论, 还不快枪沙发

发表评论

:wink: :neutral: :mad: :twisted: :smile: :shock: :sad: :roll: :oops: :eek: :mrgreen: :lol: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!:

快捷键:Ctrl+Enter