Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Sep 2001
    Location
    UK
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Can't open connection to password protected DB (VB6)

    Help, I cannot open a password protected database connection. When using the following code as the connection string, I get the error msg "Not a valid Password"

    strCon = "Provider=Microsoft Jet 4.0 OLE DB Provider" & _
    ";Data Source=" & sDbPath & _
    ";Password=workman"

    Any suggestions please. (i have a password set on the DB, but no user accounts and no system.mdw file)

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Can't open connection to password protected DB (VB6)

    I don't know enough about the Jet engine to give you expert advice, but could it be that you also need to indicate the User. For example, if opening an ADO connection to SQL Server, you need a user id:

    "Provider=MSDASQL;Driver={SQL Server};Server=BOB;Uid=sa;Pwd=test;Database=XYZ"

    Just a thought...
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Can't open connection to password protected DB (VB6)

    You're correct, Kevin. Even using Jet you have to pass the userid in the connection string to open a secured database. The question I would have here is whether the database is secured or just password protected, which isn't the same thing.
    Charlotte

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Can't open connection to password protected DB (VB6)

    Try Provider=Microsoft.Jet.OLEDB.4.0 and see if that helps. Illogical, but, the error messages don't always make sense, either.

Posting Permissions

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