How to change the password of an Access Database
Posted on January 5, 2009
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 'Database - How to change the password of an Access Database 'Add reference to Microsoft DAO 3.6 (or 3.51) Object Library Private Sub ChangeAccessPassword(ByVal sFile As String, ByVal sOldPass As String, ByVal sNewPass As String) Dim Db As Database Set Db = OpenDatabase(sFile, True, False, ";pwd=" & sOldPass) Db.NewPassword sOldPass, sNewPass Db.Close End Sub Private Sub Command1_Click() Call ChangeAccessPassword("C:\Temp\Test.mdb", "Password", "Password1") End Sub |