How to open a password-protected Access database with DAO?

  • Thread starter Thread starter Jarek
  • Start date Start date
J

Jarek

In my VB6 program, I open an Access database with a VB statement like that:

Set daoDB36 = DBEngine(0).OpenDatabase("c:\.\adatabase.mdb")

Now, I would like to protect my database with a password. I can set the
password using the MS Access application.

But, how do I open the password-protected database using VB? I don't want to
install an ODBC data source on the user computer. There must be a way to do
it with .OpenDatabase(filename)?
 
Hi,

Here's an example:

OpenDatabase("C:\MyDB.mdb", False, False, "MS Access;PWD=test")
 
Back
Top