I'm trying to create a form that lets you change the database password using the NewPassword method on a Database object. It works when that database object is set to my 'back end' file containing all my data, but for the front end I set the database object to CurrentDb and it produces error 3188: "Could not update; currently locked by another session on this machine". As far as I'm aware, I have no other sessions open. I have the database open exclusively. And I'm using DAO. See code below:
The code to change the password of the back end works fine. I've also tried using the NewPassword method on the front end from a new temporary database, while the front end is closed, and it works. I've even tried setting a password on that temporary database and using CurrentDb.Newpa ssword from within it and that works too, so it's a problem specific to my database front end.
Bizzarely, I had this working fine the first few times I did it yesterday! Any help would be much appreciated.
Code:
Dim db As Database
Set db = CurrentDb
db.NewPassword Old_Password, New_Password
Set db = OpenDatabase({Back End Path}, True, False, "MS Access;PWD=" & Old_Password)
db.NewPassword Old_Password, New_Password
db.Close
Set db = Nothing
Bizzarely, I had this working fine the first few times I did it yesterday! Any help would be much appreciated.
Comment