0
votes

System : Windows 10 64 bit

Programs installed :

  • Visual Studio 2019
  • MS Office 2019 64 bit
  • Microsoft Access database engine 2010 32bit

Connection doesn't succeed between C# and Access database.

Error message:

Microsoft Office 12.0 Access database engine OLE DB Provider.

How to successfully connect without uninstalling the Microsoft Access Database Engine 2010 32bit?

1
Change your Active Solution Platform to x86 in your Build-Configuration ManagerSteve
Your connection string is probably using ACE. So you need to change the connection string to correct version of Office. The ACE drive is ADO.NET and due to using wrong connection string it is not finding the driver. 12.0 is office 2010, 16.0 is Office 2019.jdweng
no , when i install t microsoft access database engine 2010 64bit the connection success , i need to success with microsoft access database engine 2010 32bitreguieg younes
Why would you need the 32bit version of the Provider, since the 64bit version, as you're saying, already works? Note that you cannot install the save version of the Provider in both 32bit and 64 bit, but you can have 2 different Providers with a different bitness.Jimi

1 Answers

0
votes

A few things: You mention that you have office x64 bits, but you don't mention or note if that version of office has Access included - it might not. You also mention that you have Access x32 bits installed. The BIG question then is are you wanting to run your .net application as x32, or x64?

By default, if your .net project is "ANY CPU" or x86, then your code will run as x32, and thus the installed x32 bit version of ACE from Access 2010 should work - but only if your CPU choice for .net is "ANY" or x86.

If you need or want to use a x64 bit process? Well, the you have to install the ACE/office connectivity package from office. In fact EVEN if your office install includes Access 2016 or 2019, you STILL MUST install the ACE data engine. For 2010 you don't need a separate install of ACE, but for 2016 and later, you do have to separate install ACE.

Also keep in mind if you are forcing and running your .net project as x64 bits, then the test connection inside of Visual Studio will fail, since it is a x32 bit process. (VS is a x32 bit program - so you can use connection builders in VS, but the test connection will fail for 64 bits, but running the program (even as debug) will run as x64 bits and you should/can use ACE x64 bits if its been installed. So just keep in mind that for x64 bits, the "test" connection inside of VS will not work. But running the code will.

As noted, if you trying to use x32 bits then force your VS project to x86, and test. Access 2010 ACE should be available. If it is not, then I would do a repair on the 2010 install - it may have been damaged or messed up by installing a later version of office.