Results 1 to 6 of 6

Thread: How to open a database with a password ?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    St-Ephrem,Quebec,Canada
    Posts
    2

    Post

    Hi,

    Here is what I wrote:
    'DB is a database object
    'DBE is a DBEngine object
    'FileName refer to the file to open
    Set DB = DBE.OpenDatabase(FileName, False, , "Microsoft Jet Database; pwd=mypass")
    'The password for the file is mypass
    I'm getting an "Not valid password" everytime.

    What is wrong with this code ?
    Bye

    ------------------
    ____________________
    Message from
    Remy Roy
    ____________________

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Dumb question but do you have a userid or are you trying to connect as admin (in Access)?

    The string '"Microsoft Jet Database; pwd=mypass")' would become '"Microsoft Jet Database;UID=; pwd=mypass")'

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 1999
    Location
    St-Ephrem,Quebec,Canada
    Posts
    2

    Post

    The addtition of UID did not remove the not valid password error.

    ------------------
    ____________________
    Message from
    Remy Roy
    ____________________

  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Can you open the database in Access and do you have to use a user id / password to use Access?

  5. #5
    New Member
    Join Date
    Aug 1999
    Location
    UK
    Posts
    13

    Post

    I have exactly the same problem...

    I only need to enter a password when opening the database in Access, when I try through VB it simply gives the Not A Valid Password error.

    Please can someone e-mail me if a response is given as I won't be auto-notified (not my posting). Thanks!

    ------------------
    Chris Keeble
    www.giglist.com
    mailto:[email protected]

  6. #6
    New Member
    Join Date
    Feb 2001
    Posts
    13

    Cool

    i don't know about dbengine, but iwth normal ado recordset. the syntax ia as follows:

    set the provider as follows
    sProvider = "PROVIDER=Microsoft.Jet.OLEDB.4.0.0;" & "Data Source=" & yourdbname & ";Jet OLEDBatabase Password=yourpwd;"

    hope this helps
    by!

Posting Permissions

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



Click Here to Expand Forum to Full Width