In my code :
the variable strConnect is set up with a perfectly valid string - correctly formatted. My code doesn't use visible password strings but I was able to test the value and it matched the database password exactly :
The code above kept failing with the error :
I've tried all sorts of variations of the string, but all with the same results.
How to use the OpenDatabase method to open password-protected databases in Access 2000 indicates how this string should be formatted, and mine matches that perfectly.
Code:
strConnect = Replace("MS Access;PWD=%P", "%P", Scramble(conLinkPW))
Set dbThat = wsVar.OpenDatabase(Name:=strDBPath, _
Options:=True, _
Connect:=strConnect)
Code:
MS Access;PWD=XXXXX
Code:
Run-time error 3031: Not a valid password.
How to use the OpenDatabase method to open password-protected databases in Access 2000 indicates how this string should be formatted, and mine matches that perfectly.
Comment