none
Cannot access MS-Access 2016 database from VS2019 > Visual Basic RRS feed

  • Question

  • I am writing a small Visual Basic application in VS2019 where to retrieve and update records stored in a MS-Access 2016 database (*.accdb) format. Works like a charm as long as I don't try opening a connection to the database? 

    Indeed, as long as the database is not password-protected, I can access the database to my heart content.

    But as soon as I try to protect the database with a password, in Access 2016, I can no longer open the database and keep receiving the following error message :

    What are my options?

    Wednesday, July 31, 2019 7:20 PM

Answers

  • Hello,

    See if the following steps help.

    • Open Access in exclusive mode.
    • Under the file menu, options.
    • Find client settings.
    • At the bottom of settings.
    • Change Encryption Method at the bottom. Change to selection to Use Legacy Encryption.

    Also there have been reports of encryption failing with passwords longer than 14 characters.

    The above has been tested in a GitHub repository I have on working with MS-Access


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by roger.breton Wednesday, July 31, 2019 7:39 PM
    Wednesday, July 31, 2019 7:26 PM
    Moderator

All replies

  • I have a small Visual Basic application in VS2019 where I need to retrieve and update records stored in a MS-Access 2016 database (*.accdb) format.

    For as long as the data is not password-protected, I can access the database top my heart content.

    But as soon as I try to protect the database with a password in Access 2016, I can no longer open the database from the VS Wizard or from my Visual Basic code. I keep receiving the following Error message :

    Any help is appreciated. Sorry if this posted in the wrong forum...


    Wednesday, July 31, 2019 7:08 PM
  • Hello,

    See if the following steps help.

    • Open Access in exclusive mode.
    • Under the file menu, options.
    • Find client settings.
    • At the bottom of settings.
    • Change Encryption Method at the bottom. Change to selection to Use Legacy Encryption.

    Also there have been reports of encryption failing with passwords longer than 14 characters.

    The above has been tested in a GitHub repository I have on working with MS-Access


    Please remember to mark the replies as answers if they help and unmarked 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.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    • Marked as answer by roger.breton Wednesday, July 31, 2019 7:39 PM
    Wednesday, July 31, 2019 7:26 PM
    Moderator
  • I tested with VS 2019/Access 365 and could not reproduce:

    1) created a new, blank database in access 365.
    2) created a new vb console app in VS2019
    3) in VS, added new datasource, Access, Ole. 
    4) Tested connection. worked.
    5) closed connection in server explorer.
    6) opened access in exclusive mode.
    7) encrypted with password.
    8) in server explorer clicked on database
    9) typed in password when prompted. it worked.

    Wednesday, July 31, 2019 10:12 PM