1
votes

I am trying to connect to an Access database with Jet in Visual Studio 2008, like so -

dbProvider = "PROVIDER = Microsoft.Jet.OLEDB.4.0;"

Then finding my source file to read from and opening and closing it -

con.Open() con.Close()

But, I get an error message on run time -

'The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine'

I'm running Windows 7, and the msjet40.dll is located in window's SysWOW64 folder.

Any advice would be much appreciated, cheers.

2

2 Answers

3
votes

It probably means you're trying to connect with a 32-bit application to a 64-bit driver or the reverse. So you need either to change the bitness of your exe, or to install the corresponding access driver: Microsoft Access Database Engine 2010 Redistributable

-3
votes

Jet doesn't work natively on X64.. But SQL Server does!~

How to get a x64 version of Jet? http://blogs.msdn.com/b/psssql/archive/2010/01/21/how-to-get-a-x64-version-of-jet.aspx

We have had a number of people ask about how they can get the Jet ODBC driver/OLE DB Provider as 64 bit. Windows only ships the 32 bit versions of these. The answer is that the windows versions won’t be x64 as those items are deprecated. What does deprecated mean? Here is the excerpt from the MDAC/WDAC Roadmap on MSDN:

Deprecated MDAC/WDAC Components

These components are still supported in the current release of MDAC/WDAC, but they might be removed in future releases. Microsoft recommends, when you develop new applications, that you avoid using these components. Additionally, when you upgrade or modify existing applications, remove any dependency on these components.

And here is what it lists about the Jet Database Engine:

Microsoft Jet Database Engine 4.0: Starting with version 2.6, MDAC no longer contains Jet components. In other words, MDAC 2.6, 2.7, 2.8, and all future MDAC/WDAC releases do not contain Microsoft Jet, the Microsoft Jet OLE DB Provider, the ODBC Desktop Database Drivers, or Jet Data Access Objects (DAO). The Microsoft Jet Database Engine 4.0 components entered a state of functional deprecation and sustained engineering, and have not received feature level enhancements since becoming a part of Microsoft Windows in Windows 2000.


There is no 64-bit version of the Jet Database Engine, the Jet OLEDB Driver, the Jet ODBC Drivers, or Jet DAO available. This is also documented in KB article 957570. On 64-bit versions of Windows, 32-bit Jet runs under the Windows WOW64 subsystem. For more information on WOW64, see http://msdn.microsoft.com/en-us/library/aa384249(VS.85).aspx. Native 64-bit applications cannot communicate with the 32-bit Jet drivers running in WOW64.


Instead of Microsoft Jet, Microsoft recommends using Microsoft SQL Server Express Edition or Microsoft SQL Server Compact Edition when developing new, non-Microsoft Access applications requiring a relational data store. These new or converted Jet applications can continue to use Jet with the intention of using Microsoft Office 2003 and earlier files (.mdb and .xls) for non-primary data storage. However, for these applications, you should plan to migrate from Jet to the 2007 Office System Driver. You can download the 2007 Office System Driver, which allows you to read from and write to pre-existing files in either Office 2003 (.mdb and .xls) or the Office 2007 (*.accdb, *.xlsm, *.xlsx and *.xlsb) file formats. IMPORTANT Please read the 2007 Office System End User License Agreement for specific usage limitations.