Sure thing!
Here's to code to SET the password from VB:
Code:
Dim dbs As Database
' the True argument below opens the DB in EXCLUSIVE
' mode, required for setting password
Set dbs = OpenDatabase("C:\Whatever\MyData.mdb", True)
dbs.NewPassword = "", "topsecret"
dbs.Close
Here's to code to OPEN the password-protected DB from VB:
Code:
Dim dbs As Database
Set dbs = OpenDatabase("C:\Whatever\MyData.mdb", _
False, False, ";pwd=topsecret")
Here's to code to CHANGE the password from VB:
Code:
Dim dbs As Database
Set dbs = OpenDatabase("C:\Whatever\MyData.mdb", _
True, False, ";pwd=topsecret")
dbs.NewPassword = "topsecret", "ultrasecret"
dbs.Close
Here's to code to UNSET the password from VB:
Code:
Dim dbs As Database
Set dbs = OpenDatabase("C:\Whatever\MyData.mdb", _
True, False, ";pwd=ultrasecret")
dbs.NewPassword = "ultrasecret", ""
dbs.Close
enjoy!