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

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
 
W

Wayne Morgan

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top