简体   繁体   中英

Microsoft Office 12.0 Access database engine OLE DB Provider

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM