473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Error "Not a valid password" in Access

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
2 4382
MMcCarthy
14,534 Expert Mod 8TB
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
32,556 Expert Mod 16PB
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

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

Similar topics

1
by: Kamal | last post by:
I am trying to send mail through smtp. smtp service is running on my machine. But every time during the smtpmail.send(msg) call gives "Could not access 'CDO.Message' object." error. Could some...
2
by: Paul Glavich | last post by:
As you may have guessed, its sometimes generated when the SMTP server cannot be accessed, and this is reported as saying the class cannot be registered. I assume you dont have an SMTP server on...
1
by: Jens Øster | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
3
by: Jens | last post by:
Hi I am writing a ASP.NET web application that must sent some e-mails. I get the exception “Could not access 'CDO.Message' object” when I call SmtpMail.Send. This only happens when I send...
4
by: Liz Patton | last post by:
Here's the exception: System.Exception: Unable to send mail: Could not access 'CDO.Message' object. ---> System.Web.HttpException: Could not access 'CDO.Message' object. --->...
2
by: chuckdfoster | last post by:
I am getting a "Could Not Access CDO.Message Object" Error when I try to use the following code to send an email via ASP.NET. When I run this on one machine it works, on another one it doesn't. ...
5
by: lds | last post by:
I am getting the following error: The "SendUsing" configuration value is invalid. Description: An unhandled exception occurred during the execution of the current web request. Please review the...
1
by: Jason | last post by:
I am trying to send mail via SMTP, using VB.NET on XP. I keep getting this error: "Could not access 'CDO.Message' object." (I can send mail fine via VB6, using CDONTS.) I have added a reference...
5
by: Mahendra Kumar Kutare | last post by:
I am trying to implement a webserver with boss-worker model thread pool implementation - I have a header declaration threadpool.h as - typedef struct threadpool_work { void (*routine) ();...
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.