none
Not able to connect to Access via Visual Basic?

    Question

  • When following the directions;

    (https://support.microsoft.com/en-us/help/821765/how-to-use-microsoft-visual-basic-net-to-connect-to-a-microsoft-access)

    When I create a database as instructed, it does not get saved as testdb.mbd file.

    It gets saved as C:\Users\brian\Documents\testdb.accdb.

    Then when I test the connection the following exception is thrown

    Friday, December 01, 2017 3:48 PM

Answers

  • Problem was solved by:

    downloading and installing the 2007 Office System Driver: Data Connectivity Components from
    http://microsoft.com.

    • Marked as answer by Briannnn Saturday, December 30, 2017 7:26 PM
    Saturday, December 30, 2017 7:26 PM

All replies

  • In order to create an .mdb file, open .accdb in Access, go to File, Save As, and select the .mdb format. Then close Access and try the connection again using the .mdb file.



    Friday, December 01, 2017 4:54 PM
  • Unless there is a compelling reason to use the old outdated .mdb format you should always use the newer .accdb format. The .accdb format is much safer to work with overall and is less prone to corruption which ms-access is known for especially with .mdb format.

    Otherwise Viorel_ has provided you with the solution to your question.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, December 01, 2017 5:01 PM
    Moderator
  • Hi Briannnn,

    I guess that you may forget to download  Microsoft.ACE.OLEDB.12.0 on your computer. You can get it from here:

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

    Please note your office is 32 or 64 bit.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 04, 2017 2:33 AM
    Moderator
  • Thursday, December 07, 2017 2:43 PM
  • Can you help me with this?

    Thursday, December 07, 2017 2:44 PM
  • as you can see from the screen shot it is a .accdb as you are recommending, why then the error message?

    Thursday, December 07, 2017 2:45 PM
  • Not able to do it,

    If the moderator is recommending .accdb format why the error message?

    Thursday, December 07, 2017 2:47 PM
  • I did download this
    Thursday, December 07, 2017 2:47 PM
  • Folks all I want to do and have been trying to do for some time is connect please help

    Thursday, December 07, 2017 2:48 PM
  • Read this and make your own decisions. 

    https://support.office.com/en-us/article/Choose-between-the-64-bit-or-32-bit-version-of-Office-2dee7807-8f95-4d0c-b5fe-6c6f49b8d261?CorrelationId=660a8312-c089-4007-8cc0-19199aca9d6a&ui=en-US&rs=en-US&ad=US&ocmsassetID=HA010369476

    It are many words but for me it is simpler if you read "Why to choose the 32bits version of Office" as "When can you not use the 64bit version of Office."  

    If you cannot use it in your situation. Try not to complain here about that, here are no persons of Microsoft active. 


    Success
    Cor



    Thursday, December 07, 2017 3:14 PM
  • Where can I go for help?

    Thursday, December 07, 2017 3:49 PM
  • I did download this

    What did you download? 32-bit or 64-bit? Visual Studio uses the 32-bit version. Did you install it?


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, December 07, 2017 6:35 PM
  • Also, make sure you have the correct OLEDB Provider selected. If 32-bit ACE is installed you should see it in the Provider property in the Advanced Settings.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, December 07, 2017 6:55 PM
  • Where would I find if it were 32 or 64?
    Monday, December 11, 2017 11:24 PM
  • Monday, December 11, 2017 11:30 PM
  • Monday, December 11, 2017 11:31 PM
  • How do I register?

    Monday, December 11, 2017 11:31 PM
  • Where would I find if it were 32 or 64?

    Go to the below link and click on the Download button:

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

    Select the 32-bit version, to download and then install:


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, December 12, 2017 4:13 AM
  • Tuesday, December 12, 2017 10:01 PM
  • It says I can not do it because I have 64 bit office
    Tuesday, December 12, 2017 10:02 PM
  • After a brief web search it appears that there is no 64 bit version of VS
    Tuesday, December 12, 2017 10:23 PM
  • So I am assuming that VS is 32 bit?

    Tuesday, December 12, 2017 10:23 PM
  • I did not purchase Access at the same time I purchased Office

    the two did not come on the same install

    • Edited by Briannnn Tuesday, December 12, 2017 10:28 PM
    Tuesday, December 12, 2017 10:27 PM
  • So I assume that I must delete 64 bit office and Access and install as 32 bit?
    Tuesday, December 12, 2017 10:29 PM
  • After a brief web search it appears that there is no 64 bit version of VS

    Correct. Unfortunately Microsoft did not design Office so that you can run multiple versions together; however, there is a workaround. From a Command prompt, run the install package using the /passive argument:

    After the install has completed run the Registry editor and rename or delete (I renamed) the entry for mso.dll

    If you don't do this step you may see a "Reconfiguring" message whenever you run one of the 64-bit Office apps. After completing these steps you should be able to use both the 32-bit and 64-bit ACE OLEDB Provider.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, December 12, 2017 11:31 PM
  • It says I can not do it because I have 64 bit office
    You need to uninstall the 64-bit version first then install the 32-bit version. I'm running on a 64-bit machine with the 32-bit version of the Access database engine and have zero issues.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, December 13, 2017 12:24 AM
    Moderator
  • How do I register?

    Registration is done via the installation.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, December 13, 2017 12:25 AM
    Moderator
  • Problem was solved by:

    downloading and installing the 2007 Office System Driver: Data Connectivity Components from
    http://microsoft.com.

    • Marked as answer by Briannnn Saturday, December 30, 2017 7:26 PM
    Saturday, December 30, 2017 7:26 PM
  • Problem was solved by:

    downloading and installing the 2007 Office System Driver: Data Connectivity Components from
    http://microsoft.com.


    That's the 32-bit version, which I suggested you install back on December 12th.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Saturday, December 30, 2017 10:36 PM
  • Yes but the link you gave was somehow slightly different and gave the error message about; could not install because 64 bit was already there.

    If you paste this; 2007 Office System Driver: Data Connectivity Components from
    http://microsoft.com. 

    into the search bar it will take you to: https://www.microsoft.com/en-us/download/details.aspx?id=23734

    and don't do anything but click download it will install with no error message.

    I got this from;

    Microsoft Visual Basic
    2013 Step by Step
    Michael Halvorson

    Sunday, December 31, 2017 4:23 PM
  • OK, well I did provide instructions on to handle this issue if you still have 64-bit Office installed. Remember that 2007 is an older version of the ACE OLEDB Provider, back when only 32-bit was available. It's possible that you may still encounter the issue I mentioned if you have both the 32-bit and 64-bit Access Database Engine installed.

    Paul ~~~~ Microsoft MVP (Visual Basic)

    Sunday, December 31, 2017 5:37 PM