I have built a database-interface program for my employer which works fine on 32 bit systems (including Vista 32 bit), but I need it to also work on 64 bit systems. When I install it on the only Vista 64 bit machine we have in this office, I get the attached error.
The error is thrown when TableAdapter.Fill() is called for the first time. Do I need to install something on the other 64 bit machines first, or do I need to make changes to my dataset?
Thanks.
(Error details copied in full for the sake of providing all information)
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 Virtual_Model.VirtualModelDataSetTableAdapters.MainTableAdapter.Fill(MainDataTable dataTable)
at Virtual_Model.Form1.Form1_Load(Object sender, EventArgs e)
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)
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
"Why do all my attempts at science end with me getting punched by batman?" xkcd.
The message is clearly telling you that "the 'Microsoft.Jet.OLEDB.4.0' provider" is not installed.
You might be able to get a 64 bit version of it via the link in my signature, but it is more likely that instead you will need to change from JET to ACE (via the same link, connection string examples via the apt link).
When you compile for Any CPU, your app will run in 32-bit mode on a 32-bit machine and in 64-bit mode on a 64-bit machine.
When you compile for x64, your app will not run on a 32-bit machine and it will run in 64-bit mode on a 64-bit machine.
When you compile for x86, your app will run in 32-bit mode on 32-bit and 64-bit machines.
When your app is running in 64-bit mode it will only use 64-bit libraries. As has been said, there is no 64-bit version of Jet or ACE so, if your app is running in 64-bit mode, it fails to find the required library because no such library is installed. If your app is running in 32-bit mode, regardless of the OS type, then it will successfully find and use the 32-bit Jet or ACE library you have installed.
I have an application that uses Jet and has been compiled to x86 (32-bit) and it works fine on 32-bit OS's, but it won't on my 64-Bit os, from what i have read it should work on my 64-bit os in 32-bit mode but does't i just get the:
The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine
I have an application that uses Jet and has been compiled to x86 (32-bit) and it works fine on 32-bit OS's, but it won't on my 64-Bit os, from what i have read it should work on my 64-bit os in 32-bit mode but does't i just get the:
The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine
Error message.
Anyone have any ideas?
Thanks
Either that machine doesn't have Jet installed, which is unlikely, or your app is not running in 32-bit mode. Are you absolutely sure you targeted the x86 platform? I suggest that you double check. You might also put some code in your app to specifically check what mode it's running in.
I've added <PlatformTarget>x86</PlatformTarget> into the <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> section of my .VBPROJ file.
And into the <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">