Access 2007 Command Line /compact encrypted .accdb



I am using a split database with an encrypted back end. Both front and
back ends are Access 2007 .accdb files. Everything seems to work fine
from within Access, and I can compact and repair the back end after
opening it in Access and supplying the password.

I am now trying to set up a command line to compact and repair to
happen nightly after data updates, and am running into difficulty with
the password. I am using the following syntax on the command line:

"c:\path\msaccess.exe" "c:\path\db.accdb" /compact /pwd xyz

If I omit the final "/pwd xyz", access requires me to manually enter
the encryption key and the compact & repair seems to work fine.
However this will not work for un-attended operation.

If I include the final "/pwd xyz", access displays a logon dialog with
my user name in it, and asks for a password. If I type in the
encryption password (xyz in this example), it does not work.

What am I doing wrong? Is there a different command line switch for
encryption passwords?


Tom van Stiphout

On Fri, 19 Feb 2010 05:47:19 -0800 (PST), Whit <[email protected]>

From the A2007 help file:
/pwd password Starts Access by using the specified password. Applies
to Access 2002-2003 and earlier databases only.

Unfortunately that page does not show what the correct switch would

Microsoft Access MVP

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