|
-
Dec 19th, 2000, 06:30 PM
#1
ive got an access database which i want to be password protected, how do i access this through VB6? ive tried MSDN and i cant seam to find nething
thanx in advance
chenko
-
Dec 19th, 2000, 07:08 PM
#2
Addicted Member
I got a possible answer fer ye...
Set the database password in Access, and then to access it with ADO for instance...
Code:
Dim adoConn As New ADODB.Connection
With adoConn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Open "c:\folder\file.mdb", "admin", "thatpassword"
End With
...and now you are once again cool.
-
Dec 20th, 2000, 04:18 AM
#3
PowerPoster
If your access juz password protected without applied the Workgroup information, then this should be enough.
Code:
Dim adoConn As ADODB.Connection
Set adoConn = New ADODB.Connection
adoConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Password=MyPassword;Data Source=c:\MyDatabase.mdb;"
-
Dec 20th, 2000, 06:15 AM
#4
Fanatic Member
Because Access maintains passwords in a security module, you have to pass that path in the connection string.
i.e.
"Provider=Microsoft.Jet.OLEDB.4.0;Password=password;User ID=user;Data Source=c:\MyDatabase.mdb;Jet OLEDB:System database=c:\security.mdw"
Cheers,
P.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Dec 20th, 2000, 07:39 AM
#5
Fanatic Member
It occurs to me that you may mean a Database Password as opposed to a username/password. For that you need something like:
"Jet OLEDB:Database Password=dbPassword;"
in your connection string.
Alternatively, are you trying to access Access through Automation? I cannot remember the code directly, but I will dig it out and post if you want it.
Cheers,
P.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Dec 21st, 2000, 06:33 PM
#6
yea database password
yea i do mean database password!
i use this to connect to my database
Set DB = Opendatabase("c:\myfolder\file.mdb")
the format is like this
Set DB = Opendatabase("name as string",[options],[readonly],[connect])
i looked at msdn and found that you can put a password in that peice but i can get it to work and i dont know exaclty the heck it is on bout
thanx in advance
chenko
-
Dec 21st, 2000, 08:04 PM
#7
PowerPoster
Oh... chenko, you're using DAO. then it should be look like this-
Code:
Set db = DAO.OpenDatabase("C:\1.mdb", False, False, ";pwd=1234")
Assume your password is 1234
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|