By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,510 Members | 1,451 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,510 IT Pros & Developers. It's quick & easy.

Error "Not a valid password" in Access

P: 1
Visual Basic 6
Access 97
Windows 2000

I created a database programmatically with vb. My application is able to create and open the database with the password I set. However, when I manually doubleclick on my database to open it, I type in the same password and it says "Not a valid password".

I have 4 different applications with the same code (except for queries) and 2 out of those give me that problem. Any idea as to what the problem could be? Which part of my code should I post?

here's the line of code I use to create the database
sPassword = App.EXEName
Set dbLocal = dbWorkspace.CreateDatabase(sLocalPath, dbLangGeneral & ";Pwd=" & sPassword)

and here's the line of code I use to open the database
sLocalPath = App.Path & "\PlannerSummary.mdb"
sPassword = mdbPASSWORD(sLocalPath)
Set dbLocal = dbWorkspace.OpenDatabase(sDbName, False, False, ";Pwd=" & sPassword)

mdbPASSWORD is a function that returns the password (and it returns my app name, which is PlannerSummary, with some null caracters at the end.
Dec 19 '06 #1
Share this Question
Share on Google+
2 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
As this is VB code you might find it easier to get an answer in the Visual Basic forum.

Mary

Visual Basic 6
Access 97
Windows 2000

I created a database programmatically with vb. My application is able to create and open the database with the password I set. However, when I manually doubleclick on my database to open it, I type in the same password and it says "Not a valid password".

I have 4 different applications with the same code (except for queries) and 2 out of those give me that problem. Any idea as to what the problem could be? Which part of my code should I post?

here's the line of code I use to create the database
sPassword = App.EXEName
Set dbLocal = dbWorkspace.CreateDatabase(sLocalPath, dbLangGeneral & ";Pwd=" & sPassword)

and here's the line of code I use to open the database
sLocalPath = App.Path & "\PlannerSummary.mdb"
sPassword = mdbPASSWORD(sLocalPath)
Set dbLocal = dbWorkspace.OpenDatabase(sDbName, False, False, ";Pwd=" & sPassword)

mdbPASSWORD is a function that returns the password (and it returns my app name, which is PlannerSummary, with some null caracters at the end.
Dec 21 '06 #2

NeoPa
Expert Mod 15k+
P: 31,186
Also, it depends on which password you are trying to use.
From the VB code I guess you are accessing the DB password but when Access comes up you may be prompted to enter security name and password.
Dec 21 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.