Results 1 to 3 of 3

Thread: Password protected db

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Buenos Aires, Argentina
    Posts
    64

    Angry

    Hello

    How can I open a Access database that is password protected from Access?

    I use this code to open a no password protected database.

    Set DB = MyWs.OpenDatabase(App.Path & "\Juan.mdb")

    Thanks.

  2. #2
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Juan

    this should work

    Code:
    'for database with user level security
    DBEngine.SystemDB = "MyMDW"
    Set MyWs = DBEngine.CreateWorkspace("", "Username", "Password")
    
    Set DB = MyWs.OpenDatabase(App.Path & "\Juan.mdb") 
    
    'Database password protected
    Set DB = DBEngine.OpenDatabase(App.Path & "\Juan.mdb", False, False, _
    ";pwd=password")
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2000
    Location
    Buenos Aires, Argentina
    Posts
    64
    Yes. It works very fine.

    Thanks.

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