2

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!

Fionnuala
  • 90,370
  • 7
  • 114
  • 152
JTRookie86
  • 215
  • 3
  • 5
  • 15
  • possible duplicate of [Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine](http://stackoverflow.com/questions/1991643/microsoft-jet-oledb-4-0-provider-is-not-registered-on-the-local-machine) – Roman R. Mar 15 '12 at 16:57

3 Answers3

3

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 :-)

Community
  • 1
  • 1
Kiran Solkar
  • 1,204
  • 4
  • 16
  • 29
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:

Community
  • 1
  • 1
Roman R.
  • 68,205
  • 6
  • 94
  • 158
  • 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 Mar 15 '12 at 17:09
  • Yes you need a driver wherever your have code is accessing the database. BTW `Win32` and `x86` platfroms/targets are synonyms in your case. – Roman R. Mar 15 '12 at 17:18
  • 1
    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. – Albert D. Kallal Mar 15 '12 at 21:10
  • 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 Mar 16 '12 at 16:29
0

By default .NET applications are set to run as either 32bit or 64bit applications, depending on the architecture of the operating system detected when running.

However, Microsoft.Jet.OLEDB.4.0 is not available in 64bit, and cannot be accessed by 64bit applications.

The solution, is to set the platform type in Visual Studio to "x86" (32-bit) prior to compiling, that way it will always run as a 32 bit application, even if it is running on a 64 bit operating system.

Gavin Coates
  • 1,366
  • 1
  • 20
  • 44
  • 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 – JTRookie86 Mar 15 '12 at 17:12
  • x86 - that is the 32-bit architecture. I will update my answer as "win32" is misleading – Gavin Coates Mar 15 '12 at 17:16
  • I changed the platform to x86 but it still gives me the same error when trying to run it in the 64 bit machine :( – JTRookie86 Mar 15 '12 at 17:22
  • which error, you mentioned two in your post. Setting your application to x86 should allow you to use Microsoft.Jet.Oledb.4.0 drivers. – Gavin Coates Mar 16 '12 at 09:18
  • 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 Mar 16 '12 at 16:26