PDA

Click to See Complete Forum and Search --> : Password in MSAccess with VB


aamer
Jun 14th, 1999, 10:22 PM
I wanna add security in my Access database which I use with VB, while opening the database, how would I tell the password to VB/Access; Somebody told me to add it in Opendatabase parameters but I could not resolve the problem, Can you help me???

SmithVoice
Jun 15th, 1999, 03:27 PM
it is in the OpenDatabase, as follows:

Assume: you have a Jet database ("MyJetDB.mdb") in your application location

Assume: your database password is "Fred$" (no quotes)

To open the database, you would:

Private Sub ButOpenDB_Click()

dim dbCurrent as database
set dbCurrent = Workspaces(0).OpenDatabase(app.path & "\MyJetDB.mdb", false, false, ";pwd=Fred$")

End sub


------------------
http://www.smithvoice.com/vbfun.htm