Startup command-line options

Startup command-line options

The following table lists the Microsoft Access command-line options.

Option Effect Applies To
database Opens the specified Microsoft Access database or Microsoft Access project. Include a path if necessary. If you are running Microsoft Windows 95, the default path is your My Documents folder. Access database or Access project
/excl Opens the specified Access database for exclusive access. To open the database for shared access in a multiuser environment, omit this option. Access database only
/ro Opens the specified Access database or Access project for read-only access. Access database or Access project
/user user name Starts Microsoft Access by using the specified user name. Access database only
/pwd password Starts Microsoft Access by using the specified password. Access database only
/profile user profile Starts Microsoft Access by using the options in the specified user profile instead of the standard Windows Registry settings created when you installed Microsoft Access. This replaces the /ini option used in versions of Microsoft Access prior to Access 97 to specify an initialization file. Access database or Access project
/compact target database or target Access project Compacts and repairs the Access database, or compacts the Access project that was specified before the /compact option, and then closes Microsoft Access. If you omit a target file name following the /compact option, the file is compacted to the original name and folder. To compact to a different name, specify a target file. If you don't include a path in target database or target Access project, the target file is created in your My Documents folder by default.

In an Access project, this option compacts the Access project (.adp) file but not the Microsoft SQL Server database.

Access database or Access project
/repair Repairs the Access database that was specified before the /repair option, and then closes Microsoft Access.

In Microsoft Access 2000, compact and repair functionality is combined under /compact. The /repair option is supported for backward compatibility.

Access database only
/convert target database Converts a previous-version Access database to an Access 2000 database with a new name, and then closes Microsoft Access. You must specify the source database before you use the /convert option. Access database only
/x macro Starts Microsoft Access and runs the specified macro. Another way to run a macro when you open a database is to use an AutoExec macro. Access database or Access project
/cmd Specifies that what follows on the command line is the value that will be returned by the Command function. This option must be the last option on the command line. You can use a semicolon (;) as an alternative to /cmd.

For information on the Command function, click .

Access database or Access project
/nostartup Starts Microsoft Access without displaying the startup dialog box (the second dialog box that you see when you start Microsoft Access). Access database or Access project
/wrkgrp workgroup
information file
Starts Microsoft Access by using the specified workgroup information file. Access database only

Notes