Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Password to an Access Database

Status
Not open for further replies.

ptipat

Programmer
Jan 2, 2002
4
0
0
CA
I'm connecting to an Access Databse in ADO. My connection string looks like this in my ini file: Provider=Microsoft.Jet.OLEDB.3.51;Data Source=D:\Documents À Patrick\VisualBasic\Inventaire_2\Data\Test3.mdb;User ID=;Password=;

If I put a password to this database in Access, I always gets this error in my VB program (after adding the same password in my connection string):
"Can't start your application. The workgroup information file is missing or opened exclusively by another user."

Can someone help me with this please !!!

Sorry for my bad english... I'm from Montreal!

Thanks.
 
Try using this string:

Provider=Microsoft.Jet.OLEDB.3.51;Data Source=D:\Documents À Patrick\VisualBasic\Inventaire_2\Data\Test3.mdb;User ID=;Password=;Jet.OLEDB.Database.Password="password";

or what you can do is thus:

1. Create a new, blank text document on your desktop
2. Rename it something.udl (just so it has the .udl extension)
3. Double-click on it and select your database and drivers.
4. On the last tab("All"), select the Jet OLEDB.Database Password and click "Edit Value"
5. Enter the database password in the box and close it.
6. Return to the "Connection" tab and test the connection.
7. If it works, then open the udl file up in notepad and copy the connection string and paste it into your ini file.

Jason
 
Thanks Jason for your help but it's still not OK. When I double-click the .UDL file and that I enter every parameters correctly, I've got the same error as in VB when a try the "Test connection" button !!!!
 
did you enter the database password in the correct value?

jason
 
Hi Jason,

Thanks a lot for trying to help me but it's still not working. Yes, my password is in the correct value. I don't really know what's going on. What is a .MDW file ? This file looks like a "workgroup information file" but how do we create this and why ?!?!?
 
Hi ptipat,

I had the same problem but got over it using code like below:

Dim oConn As ADODB.Connection

Set oConn = New ADODB.Connection

With oConn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Jet OLEDB:Database Password") = "YourPassword"
.Mode = adModeReadWrite
.Open "D:\Documents À Patrick\VisualBasic\Inventaire_2\Data\Test3.mdb"
End With

Hope This Helps,

Codefish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top