Discussion Locked

VB DAO ACCESS MDB Password protection

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

5 replies

by absub1

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

by vinnyd

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

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

the type is not needed.

This discussion is closed to new replies.