Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine

I have installed the 'Microsoft Access Database Engine 2010 Redistributable' as described in the blog entry

http://danielcai.blogspot.com/2011/02/solution-run-jet-database-engine-on-64.html

and it works in my windows-forms application. I now want to add some unit-tests and when running the unit-test I get the above error. I have checked my references but can't seem to figure out why it works in the application and not in the unit-test.

I'm working in VS2010 on a windows 7 ultimate x64 installation.

Can someone please help me ?

like image 668
Jurjen Avatar asked Jun 08 '11 20:06

Jurjen


People also ask

How do I fix the Microsoft ACE Oledb 12.0 provider is not registered in VB net?

Thus in such case, you will need to uninstall the 64 BIT (x64) version of the driver and then will need to download and install 32 BIT version of Microsoft Access Database Engine 2010 Redistributable file.


1 Answers

The Target Platform is probably set to Any CPU, which means when you run it from VS or in your 64-bit Windows it will execute as 64-bit code (and use the 64-bit Jet driver). But a typical unit test runner is executing in 32-bit mode and all assemblies it loads will then execute in 32-bit mode (since your project target platform is Any, ie either 32 or 64 bit). And Windows 7 does not come with a 32-bit Jet driver by default.

like image 76
Haukman Avatar answered Oct 13 '22 05:10

Haukman