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

Bob Wentzel 6 Reputation points
2021-06-14T14:09:56.17+00:00

I am unable to get beyond this error when trying to add a Microsoft Access database (.accdb) as a data source in Visual Studio 2019. I’ve tried to add this data source to a Visual Basic and C# program with the same results. I’ve followed guidance I’ve found on the Internet and added the 2010, 2013, and 2016 Access database engines all with the same result. I’ve changed the TargetCPU to AnyCPU, X86, and X64 all with the same result. I can add an Access .mdb database as a data source but not an .accdb and my application requires the later database format.

My system is running Windows 10 x64 with Office 365 and Visual Studio 2019 all with the latest updates.

Disclaimer: I am a hobbyist programmer and this application is for a single user (me) and I prefer to use Access because I have it as part of Office 365 and it is easy to create and view dataset objects and their content. Many do not like Access and that’s understandable in a business multi-user environment. Many also prefer other languages like Python but I will stick with Visual Basic (or possibly Micro Focus COBOL) for personal reasons. Lastly, my request for help is not an invitation to you to try to sell me your curriculum (as experienced on Facebook).
105426-add-connection.jpg105375-choose-data-source.jpg105365-error.jpg105408-targetcpu.jpg

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,542 questions
Access Development
Access Development
Access: A family of Microsoft relational database management systems designed for ease of use.Development: The process of researching, productizing, and refining new or existing technologies.
810 questions
{count} vote

4 answers

Sort by: Most helpful
  1. Albert Kallal 4,566 Reputation points
    2023-01-24T23:39:29.3+00:00

    You have several choices here.

    You can consider a upgrade to vs2022. it is the FIRST version of VS that is x64 bits.

    Or, you can consider downloading the x32 bit version of the ACE data engine. (this is quite a bit less then say trying to install Access (free runtime) or in fact installing office/Access.

    However, assuming that you do already have office x64 installed (and if that includes Access)? I think best bet is to go with vs2022.

    However, you can as noted download + install the ACE x32 bit version.

    that can be found here:

    [https://www.microsoft.com/en-us/download/details.aspx?id=54920

    And you can install from above either the x64 bit verison of ACE, or the x32 bit. (if you do however install the x32 bit verison, then you have to force your project to x86, and not x64.

    However, if you want, you can of course install ACE x64, and force your project to x64. EVEN dispite the fact that vs is x32 bits, it will still work (the test connection button will NOT work, but when you run your code, it will.

    DO KEEP in mind that since you have office x64 installed, then if you do choose to go with x32? The installer will complain about this, but you can "by pass" that issue by opening a command line window, and typing in this:

    eg this:

    $yourPath$\AccessDatabaseEngine.exe /passive
    

    So, you have many choices here. As noted, with your current setup (vs x32), and office x64? I suggest htat you download + install the x32 bit version of ace, and then as noted, force your project to run as x32.

    Another road as noted? Install vs2022, and then force/keep your project as x64 bits, and download + install the x64 bit version of ACE.

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta, Canada

    1 person found this answer helpful.
    0 comments No comments

  2. Olaf Helper 40,156 Reputation points
    2021-06-14T14:18:26.84+00:00

    Visual Studio is a 32 bit application and therefore you have to install ACE as 32 bit data provider to use it in VS wizards; have you?

    0 comments No comments

  3. Bob Wentzel 6 Reputation points
    2021-06-14T15:53:58.997+00:00

    I was surprised to learn that VS2019 is a 32 bit application so thanks for that bit of knowledge.

    I am unable to install the 32 bit Access engine because my Office 365 is 64 bit. Also, I can add .mdb Access databases as a data source using the same process so I wonder if there is something else going on. Thanks for your recommendation.


  4. AlphonseG 191 Reputation points
    2023-01-24T15:29:39.0433333+00:00

    You can install the Access engine via admin command line using the quiet switch. Been doing it for years on several machines.

    accessdatabaseengine.exe /quiet

    0 comments No comments