How to fix .NET app using Microsoft.Jet.OLEDB.4.0 on Windows 7 64-bit

You are happy Windows 7 user and one day you install an application, which was just fine on Windows XP, Windows Vista, run it and get…

„Microsoft.Jet.OLEDB.4.0′ provider is not registered on the local machine”  (or „Dostawca ‚Microsoft.Jet.OLEDB.4.0′ nie jest zarejestrowany na lokalnym komputerze.” in Polish)

What’s wrong? Microsoft just „forgot” to implement Jet 4.0 in 64-bit mode.

How to fix it?

Run CorFlags.exe tool (available with Windows SDK package) to force app to be run in 32-bit mode (32-bit Jet 4.0 IS implemented)

CorFlags.exe <application exe file> /32BIT+

The side effect is that strong name signature is broken. If you have SNK key file with the private signing key you can re-sign the executable using SN.exe

SN.exe -R <application exe file> <snk file>

Reklamy