connect to access database failed??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, everyone

I use Access2003 create a database such as db1.mdb. without set login password. My web application can access it well
But after I set login password, when i test the connection in visual studio .net. I always get follow information

Test connection failed because of an error in initializing provider. Cannot start your application. The workgroup information file is missing or opened exclusively by another user

obviously, no other user open db1.mdb at this time

Could anyone help? Thanks a lot

haiwen
 
Hi Haiwen,

Thank you for posting in the community!

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you set a password to the Access
2003 database, an error will be generated if you connect to that database.
If there is anything unclear, please feel free to let me know.

I'd like to know if this password is a user password or a database
password, since the two kinds of password are set differently in the
connection string.

If you are using a database password, the database password is specified as
"Jet OLEDB:Database Password=123" in the connection string. You can also
set this in the Data Link Properties dialog box. In the All tab, double
click Jet OLEDB:System database property and set password to it. If you
only set the database password, no user password is needed for the
connection string.

If you are working on user password, you also have to specify the System
database property for Jet OLEDB. The System Database is a .mdw which
contains the workgroup administrator information for some .mdb databases.
We can get the corresponding system database file with the following steps:

1. Open the .mdb database file.
2. Select Tools/Security/Workgroup Administrator from the menu.
3. You can see the path for that .mdw file in the Workgroup field.

In the connection string, you can add the following:

Jet OLEDB:System database=<path and filename for the .mdw file>; User
ID=myname; Password=mypass;

HTH. Does this answer your question? If anything is unclear, please feel
free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
hello, kevin yu:

Thanks so much for your help, it works now. I was confused by the database password and user's password before.

Thanks again.

haiwen
 
Hi Haiwen,

You're welcome. If anything is unclear, please feel free to post them in
the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
I had developed an client/server application in VB 6 where in I do not
know in advance where the MS access data base 2000 is installed Like I
have given path as APP.path & \Mydb.mdb. How I could write the same
for Data environment where in the path is to supplied at run time
only.

This is not a group for VB 6, but .NET. Regardless, the answer is the same.
You have to store the connection string for the environment in question in
a file. In .NET, it is a .config file. With older COM based programming,
the default was an .ini file.
I hope I am clear. Pl mail me the solution

Apologies, but I generally don't take the time to email stuff. If you are
interested enough in an answer, I feel you can come back and get it.

Peace and Grace,

--
Gregory A. Beamer (MVP)

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top