Public Sub SetDatabasePassword(DBFile As String, Password
As String)
Dim db As Database
' open the database
Set db =
OpenDatabase(DBFile, True)
' set
the new password
db.newPassword "",
Password
' close the
database
db.Close
End Sub
Private Sub Command1_Click()
Call
SetDatabasePassword("c:\YourDir\DataBaseFileName.mdb", "TheNewPassword")
End
Sub