Results 1 to 2 of 2

Thread: Is it possible to pass a Password from VB to Microsoft Access in runtime.

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 1999
    Location
    Brisbane, QLD, Australia
    Posts
    10

    Unhappy

    I have created an App that uses a MSAccess database.I want to place a password for the DB to prevent prying eyes from seeing the contents, this process is easy enough from MSAccess. But when I try to run the App, it cant access the DB. Is there a way to pass the Password from my App to the DB on startup. I am using VB5 with Microsoft Access.

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657

    You need to supply the password when you open the database with the OpenDatabase method in VB. If your Access password was "topsecret", the code to open the DB in VB app would be:

    Code:
    Dim dbs As Database
    Set dbs = OpenDatabase("C:\Whatever\MyData.mdb", _
                           False, False, ";pwd=topsecret")
    "It's cold gin time again ..."

    Check out my website here.

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