General discussion

Locked

VB DAO ACCESS MDB Password protection

By absub1 ·
I have written a program in Visual Basic.
The program uses DAO 3.51
Back end is a MS-Access mdb file

Now I want to add password protection.
I have set up password for the mdb.

I am using the
Set ws = DBEngine.CreateWorkspace("Temp", "admin", "")

Set db = ws.OpenDatabase("c:\mydata.mdb")

the using a recordset object.

Now where and how does the password fit in?

If you could give me working code, I will be very happy.

Thank you

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB DAO ACCESS MDB Password protection

by andrew In reply to VB DAO ACCESS MDB Passwor ...

I believe the Connect property of the OpenDatabase method takes the password:

Set db = ws.OpenDatabase("c:\mydata.mdb", False, False, "MS Access;pwd=password")

Here's a link that talks about it:

http://support.microsoft.com/support/kb/articles/Q209/9/53.ASP

(make sure there are no spaces in the URL)

Collapse -

VB DAO ACCESS MDB Password protection

by absub1 In reply to VB DAO ACCESS MDB Passwor ...

Yes you were perfectly correct. I did figure it out myself also searching in the MSDN.
Any way Thanx a million.

Collapse -

VB DAO ACCESS MDB Password protection

by VinnyD In reply to VB DAO ACCESS MDB Passwor ...

Set workspace = CreateWorkspace(name, user, password, type)

Set ws = DBEngine.CreateWorkspace("Temp", "admin", "password goes in here")

the type is not needed.

Collapse -

VB DAO ACCESS MDB Password protection

by absub1 In reply to VB DAO ACCESS MDB Passwor ...

Poster rated this answer

Collapse -

VB DAO ACCESS MDB Password protection

by absub1 In reply to VB DAO ACCESS MDB Passwor ...

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums