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