Example of Creation of New Access DB Through Code ...

  • Thread starter Thread starter Andrew Peskin
  • Start date Start date
A

Andrew Peskin

I would like to do the following: Create a new Access DB through Visual
Basic Code, which is password protected for read/write access as well as
encrypted. I know this can be done, I just don't know how to do it. I
presently can create a new Access DB through Visual Basic Code with no
problem, I just don't know how to add the password protection and
encryption.

Thanks in advance for your help.

Andrew
 
If using DAO the command line to create a database is

Set database = workspace.CreateDatabase (name, locale, options)

If you use the following line for the locale argument, you can set the password. If you
have a locale specified, concatenate the line to the locale you have specified.

";pwd=NewPassword"
or
dbLangSpanish & ";pwd=NewPassword"

To encrypt the database use dbEncrypt for the options argument.
 
Back
Top