Change the password of the database from smith to jones : Access Environment « Access « VBA / Excel / Access / Word






Change the password of the database from smith to jones

 
Sub changePassword()
   Dim myConnection As ADODB.Connection
   Dim strPassword As String

   strPassword = "ALTER DATABASE PASSWORD [jones] [smith];"

   Set myConnection = New ADODB.Connection
   With myConnection
      .Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & CurrentProject.Path & "\mydb.mdb;"
      .Execute (strPassword)
    End With
End Sub

 








Related examples in the same category

1.Changing the Access Environment
2.Use Access Special Keys
3.Changing Options
4.Creating a Password Programmatically with SQL command
5.Add or delete users
6.Create user for Access database