Results 1 to 7 of 7

Thread: How to Open MSAccess data with Password protected

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    11

    Post

    Hi there!

    Need help on VB5. I tried number of times to Open MSAccess data(I protect with a password on it), when I run my program in VB5 & it prompt me "Run-time error 3031, Not a valid password, therefore I can't open it. Anyone can help me, how to decode MSAccess password in VB5 statement. Thanks

    Rgds,
    Sam


  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,175

    Post

    This is DAO

    DBEngine.SystemDB = C:\MyPath\My.MDA"
    DBEngine.DefaultUser = "MyUserName"
    DBEngine.DefaultPassword = "MyPassword"


    ------------------
    Marty

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    11

    Post

    Thanks Marty, will try it out...

    Rgds,
    Sam

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    11

    Post

    Hi Marty,

    It still prompt me "Run-time error 3031, Not a valid password"

    I protected MSAccess file with password(Not the Admin/User password).

    Rgds,
    Sam

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    11

    Post

    Here's my Email samccw@excite.com

  6. #6
    Member
    Join Date
    Nov 1999
    Posts
    63

    Post

    Accessing a password protected MSAccess database:

    Using DAO...

    Code:
    Dim db As DAO.Database
        
    Set db = DBEngine(0).OpenDatabase("C:\YourDatabase.mdb", True, False, ";pwd=YourPassword")
    Using ADO...

    Code:
    Dim cn as ADODB.Connection
    
    Set cn = New ADODB.Connection
    cn.Provider = "Microsoft.Jet.OLEDB.3.51"
    cn.ConnectionString = "Data Source=C:\YourDatabase.mdb;Jet OLEDB :database password=YourPassword"
    cn.CursorLocation = adUseClient
    cn.Open

    [This message has been edited by Gerald (edited 12-07-1999).]

  7. #7

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Posts
    11

    Post

    Thanks Gerald...

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