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

cms-accessoledbwindows-7-x64

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!

Best Answer

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

Related Topic