Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2004
    Posts
    15

    Arrow Unanswered: DAO Opendatabase method with password

    THE FOLLOWING CODE WORKS FINE WHEN MY .MDB HAS NO PASSWORD:

    Dim db As DAO.Database
    Const connectionstring = "S:\Product Support\ExternalDatabase.mdb"
    Set db = OpenDatabase(connectionstring, , True)
    ------------------------------------------------------------------------
    WHEN I MAKE THE PASSWORD to ExternalDatabase.mdb="green" AND CHANGE MY CODE TO:

    Dim db As DAO.Database
    Const connectionstring = "S:\Product Support\ExternalDatabase.mdb"
    Set db = OpenDatabase(connectionstring, , True, "pwd=green;")

    I KEEP GETTING "Runtime Error 3031, Not a Valid Password".
    I HAVE ALSO TRIED
    Set db = OpenDatabase(connectionstring, , True, "pwd='green';")
    AS WELL AS ABOUT 100 OTHER THINGS (playing with the parameters in the connect argument) BUT I KEEP GETTING THE SAME ERROR (YES, I AM SURE THE CORRECT PASSWORD IS "green").

    I have been all over MSDN.com and can not figure out what is wrong with my code. Hopefully this will be obvious to someone out there.

  2. #2
    Join Date
    Feb 2004
    Location
    CT,USA
    Posts
    250

  3. #3
    Join Date
    Mar 2004
    Posts
    15
    Thanks. You rule!

  4. #4
    Join Date
    Jun 2011
    Location
    Stockholm, Sweden, Europe
    Posts
    1

    Talking

    Thanks! That helped me too.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •