I am a newbie and need help removing a password. This link explains my exact problem. I have entered and changed the code as stated however it does nothing...Any help??? Thanks
http://vajentic.blogspot.com/2008/08/removing-password-that-was-created-in.html
Here is my version:
Public Sub ChangeDBPassword()
Dim objConn As ADODB.Connection
Dim strAlterPassword As String
On Error GoTo ChangeDBPassword_Err
' Create the SQL string to change the database password.
' Here, LOCK is the old password, and I am wanting to set the password to NULL
strAlterPassword = "ALTER DATABASE PASSWORD NULL [LOCK];"
' Open the secured database.
Set objConn = New ADODB.Connection
With objConn
.Mode = adModeShareExclusive
'.Provider = "Microsoft.Jet.OLEDB.4.0"
'I had to update the Provider information for Access 2007, as the code was quite old.
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Properties("Jet OLEDB
atabase Password") = "LOCK"
'The following specifies the location of the database of which PW I'm trying to change.
.Open "Data Source= C:\Users\lowana.hernandez\Desktop\SCG 9-30-13 (2).accdb;"
' Execute the SQL statement to change the password.
.Execute (strAlterPassword)
End With
' Clean up objects.
objConn.Close
Set objConn = Nothing
ChangeDBPassword_Err:
MsgBox Err.Number & ":" & Err.Description
End Sub
http://vajentic.blogspot.com/2008/08/removing-password-that-was-created-in.html
Here is my version:
Public Sub ChangeDBPassword()
Dim objConn As ADODB.Connection
Dim strAlterPassword As String
On Error GoTo ChangeDBPassword_Err
' Create the SQL string to change the database password.
' Here, LOCK is the old password, and I am wanting to set the password to NULL
strAlterPassword = "ALTER DATABASE PASSWORD NULL [LOCK];"
' Open the secured database.
Set objConn = New ADODB.Connection
With objConn
.Mode = adModeShareExclusive
'.Provider = "Microsoft.Jet.OLEDB.4.0"
'I had to update the Provider information for Access 2007, as the code was quite old.
.Provider = "Microsoft.ACE.OLEDB.12.0"
.Properties("Jet OLEDB

'The following specifies the location of the database of which PW I'm trying to change.
.Open "Data Source= C:\Users\lowana.hernandez\Desktop\SCG 9-30-13 (2).accdb;"
' Execute the SQL statement to change the password.
.Execute (strAlterPassword)
End With
' Clean up objects.
objConn.Close
Set objConn = Nothing
ChangeDBPassword_Err:
MsgBox Err.Number & ":" & Err.Description
End Sub