Changing Database password

keb1965

Well-known member
Joined
Feb 9, 2009
Messages
103
Programming Experience
10+
Ok, I have an issue that I have searched for and I can't seem to find any resolution.

I have a database that is password protected and the password is currently hard coded into the programming, not for security reasons, but merely to prevent unauthorized users from changing it without using the front end application. However, since the application will be deployed across several stations and since the database is shared, we have decided that it would be best to require the user to log into the database via the front end program.

Everything worked as expected, until I was asked to create an interface to allow the database password to be changed from the front end. So, I created a password change form and set the connect string to:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyData.mdb;Mode=12;Jet OLEDB:Database Password=" & passwd & ";"

I can connect fine and no exception is thrown, so then I execute the SQL string on the database changing the old password to the new password, again, no errors whatsoever, but the password does not change.

"ALTER DATABASE PASSWORD " & strNewPass & " " & strOldPass & ";"


I am nearly bald from the hair pulling. Is there any kind soul who can point me in the right direction?
I connect to
 
Ok, problem resolved ...
If the database doesn't have a password set, an empty string is used, it must be set to null.

crisis averted
 
Back
Top