Getting Microsoft.jet.oledb.4.0 or microsoft.ace.oledb.12.0 to work on 64 bit Windows 7 machine

25,866

Solution 1

100 % working Solution

When you run your .NET Application – and I know this – on your x64 box, its because Microsoft does not support JET on 64bit versions of Windows outside of Windows 2003.

So, what to do? Simple, you need to make sure that the assembly is written targeting ‘x86′ rather than ‘Any CPU’ or ‘x64′ in the Configuration Manager, rebuild the assemblies and you should be good to go :-)

Solution 2

Jet DB (MS Access, AKA Microsoft.Jet.OLEDB.4.0) is only available in 32-bit. There is no 64-bit version. You have to target to Win32 platform, or switch to another database.

UPD. Appears to be covered by an earlier post: Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine

As for "ACE" you perhaps need an additional driver to be installed:

Share:
25,866
JTRookie86
Author by

JTRookie86

Updated on March 10, 2020

Comments

  • JTRookie86
    JTRookie86 about 4 years

    I have an application that was built on a Windows XP 32 bit machine. The .exe file of the application has no problem running on XP 32 Bit machines. However; it will not run on a Windows 7 64 bit machine. When I try to run it in Windows 7, I get the following error:

    Microsoft.jet.oledb.4.0 provider is not registered on local machine.

    I read somewhere that Microsoft.Jet.Oledb.4.0 cannot be used on 32 bit machines. Therefore; I changed the connection string in my config file to have the data provider set to microsoft.ace.oledb.12.0. I published my fies and tried to run it on the Windows 7 machine. I got the following error:

    Microsoft.ace.oledb.12.0 is not registered on the local machine.

    My application was converted from Visual Studio 2005- 2010 and is programmed in c#.

    Any suggestions?

    Thanks!

  • JTRookie86
    JTRookie86 about 12 years
    Thank you for your reply Roman. If I install the driver on the machine that I am developing my application in, will the machine running my app need to have that driver installed as well?
  • JTRookie86
    JTRookie86 about 12 years
    Gavin, for platform types I only see Active (Any CPU), Any CPU, X64, X86, All Platforms, and Multiple Platforms. I don't see anything for Win32
  • Gavin Coates
    Gavin Coates about 12 years
    x86 - that is the 32-bit architecture. I will update my answer as "win32" is misleading
  • Roman R.
    Roman R. about 12 years
    Yes you need a driver wherever your have code is accessing the database. BTW Win32 and x86 platfroms/targets are synonyms in your case.
  • JTRookie86
    JTRookie86 about 12 years
    I changed the platform to x86 but it still gives me the same error when trying to run it in the 64 bit machine :(
  • Albert D. Kallal
    Albert D. Kallal about 12 years
    If you are using x32, then jet should be available and is installed by default. Your issue might very well be that the oleDB providers are not present. As noted is a VERY good idea here to stick to x32. JET is the better choice since it been installed on every copy of windows since windows 98SE. If you REALLY do need x64 then there is an x64 bit version of ACE which is the new successor to JET (and is compatible with JET in regards to reading mdb/accdb files). ACE is available in both x32 and x64 and there is a installer package for just ACE.
  • Gavin Coates
    Gavin Coates about 12 years
    which error, you mentioned two in your post. Setting your application to x86 should allow you to use Microsoft.Jet.Oledb.4.0 drivers.
  • JTRookie86
    JTRookie86 about 12 years
    The "microsoft.Jet.Oledb.4.0' provider is not registered on local machine. I changed the compile and debug platform to x86 for the project and the DLLs but I am still getting that error. Was I supposed to change something else to x86?
  • JTRookie86
    JTRookie86 about 12 years
    Albert, I am a bit hesitant to try ACE because I would have to install the driver not only on the machine that the application is built on, but also the machines where the executable will be ran from. Because I won't have access to all of the machines that will be running the executable, I want to avoid any solution that requires those machines to be installed with drivers. I tried changing the compile and debug platform of the app to x86 but it still produces that error when the executable is run from the Windows 7 64 bit machine. It does not cause error when run on a 32 bit machine.
  • JTRookie86
    JTRookie86 almost 11 years
    Simple, easy, and most importantly WORKS