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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open dbAccess with password in VB

Status
Not open for further replies.

Diogo

Technical User
Mar 22, 2001
143
PT
Hello.

I´m trying to put a password on a dbAccess but then i can´t open it in vb.

The command that i'm using is this:

BD.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Programs\BD.mdb" (without password)

But when i put a password in the dbAccess (not a user or group Access) i can't configure the line command.
There is some one who could help me.

Thanks any way.

DR
 
Hi,
I looked at something similar to this a little while ago. I think I'm right in saying that you need to have a workgroup file associated with your .mdb in order to open a password-protected .mdb.

This is what worked for me (note that I decided to use 3.51 instead of 4.0 - can't think why that was now but I must have had a good reason!):

Set AccConn = New Connection
With AccConn
.Provider = "Microsoft.Jet.OLEDB.3.51"
.Mode = adModeShareExclusive
.ConnectionString = &quot;Data source=<.mdb path and filename goes here>;Jet OLEDB:System Database =<workgroup .mdw path and filename goes here>;Jet OLEDB:Database Password = <your password>&quot;
.open
End With
 

Thanks,

It's just what i want.

DR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top