CodeItBetter Programming Another VB Programming Blog

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
Filed under: Database Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.