Share via

Connecting database to visual studio project

Anonymous
2020-08-10T10:36:16+00:00

I am trying to connect my Access database to my visual studio Python Application. However, when I try and connect it, an error message appears saying 'the Microsoft.ACE.OLEDB.12.0 providor is not registered on the local machine'. I then downloaded the access database engine_x64 and the access database engine, but neither have helped, and the same message appears. I then tried to change the providor to Microsoft.Jet.OLEDB.4.0, however an error message appeared saying that the databased format was unrecognized. My database is only accessed by myself and is very simple. Does anyone know how to connect them?

Many thanks. 

[Move from Access/Windows 10/Microsoft 365 Apps or Office 365 for business]

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

8 answers

Sort by: Most helpful
  1. Anonymous
    2020-08-18T13:05:32+00:00

    Hi, 

    I've downloaded the access database engine you showed me above - I used the 64 bit one. I did it many times but it does not seem to help, the issue still occurs. Is there anything else I need to do after? I have forced it to 64 bit CPU, but noticed that when I run the programme, the header of the window mentions x86??

    Also, in your first reply, you suggested I download the access looker - I did this but when I tried to run it the same error message appeared as the one in visual studio - Is this to do with the access database engine issue above? 

    Many thanks

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-08-12T21:15:45+00:00

    Hi Martha,

    Feel free to post back if you need further assistance. 

    Best Regards,

    Waqas Muhammad

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2020-08-11T06:02:26+00:00

    Just keep in mind:

    If you are developing using x64 bits and you have your project forced to x64 (as opposed to "ANY" cpu, or x86?

    Ok, keep in mind that you CAN use the connection string builders in Visual Studio, but if you use the last step "test connection", it WILL NOT work. This is because VS is a x32 bit application. However, if you run your code, then it will run (and debug) as x64 bits if that is your project setting.

    So, just remember you can NOT use the "test" connection in VS if you using x64 (you can use the connection builder - just not that last step of test connection - you have to run the project).

    So, being that you HAVE installed the ACE x64 bit version? Then it should work, but as noted, you have to run the code.

    If the project does not connect when you run it? Hum, ok, then  you might not have ACE installed.

    I have a working sample here:

    You can un-zip to a folder - click on it. I have a x32 version, and a x64 version. It will thus allow you to check/test to see if ACE CAN work on your box.

    The program is VERY small (as .net usually is!!).

    The program will let you browse to any accdb (or mdb) file, and open/display and browse the tables.

    It looks like this:

    Note how it states x32 bits.

    So there are two small .exe. One for x64, and one for x32. You can simply run it, browse to a accDB file (or mdb), and hit Open Database file.

    This will allow to you test/check if you have a working copy of ACE that works with .net

    You can find the above zipped file here:

    .net access browser (zip file)

    So, 2 things:

    1. if you using the test connection (the connection builder) in VS - it will ALWAYS fail for ACE x64 (and a project set to run as x64 bits - and I strong recommend you set the project - do NOT use "any cpu" for the project. You must Force this issue.

    However, you have to run the project, and you CAN NOT use "any cpu" - you must force the project to x64. And you have to run the project also to see if you can connect - you can't test/use the VS UI for a test - since the test connection button in the VS connection builders will NOT work (due to VS being a x32 bit program).

    if you using test connection in a x32 VS project and ACE x32, and of course the project forced to x86(x32) - test connection button in the connection builder will work, and you don't have to run the project.

    1. make sure you installed the correct bit size version of ACE. Installing relative recent versions of full MS Access, or MS Access runtime DOES NOT expose the ACE engine from Access anymore. You have to install ACE - installing Access will NOT suffice.

    And you can take 50 seconds - try the above sample zip. It has a x32, an a x64 bit compiled tiny .exe. Run both - see which one works and you instant know if you have a working copy of ACE that .net can consume.

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2020-08-10T21:03:13+00:00

    Hi Martha,

    As per your error message, here’s a discussion about this error, please refer to it and let me know whether it is worked for you.

    HOW TO: FIX ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine"

    For further investigation, I would like to confirm following information:

    1.Does issue happen to specific access database.  

    2.Please share your current Access version (Product name and Full version number)

    1. Screenshot of error message with us.

    I appreciate your patience and understanding.

    Best Regards

    Waqas Muhammad

    Was this answer helpful?

    0 comments No comments
  5. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2020-08-10T15:15:00+00:00

    Yeah it can be hard to figure out, with competing versions, installation technology, and bitness.

    I would consider side-stepping the issue and use the free SQL Server Express Edition.

    Was this answer helpful?

    0 comments No comments