ACC: How to Use Command-Line Switches in Microsoft AccessID: Q105128
|
Moderate: Requires basic macro, coding, and interoperability skills.
When you run Microsoft Access from the Start menu or a shortcut, (or
Program Manager or File Manager in Microsoft Windows 3.x), you can use
command-line switches to modify the startup process. For example, you can
open a particular database, run a macro, or supply a password.
Microsoft Access recognizes the following command-line switches:
In version 1.x only:
/s Bypasses the Microsoft startup screen.
[Run-Time Options]
StartupScreen=C:\LOGO\MYBITMAP.BMP
/Ini <initialization file> Starts Microsoft Access using the options in
the specified initialization file instead of
the standard MSACC20.INI file. The
initialization file must have the same
entries as the standard MSACC20.INI file.
<database> Opens the specified database.
/Excl Opens the database for exclusive access.
/Ro Opens the database for read-only access.
/User <user name> Starts Access using the specified user name.
You'll be prompted for the path to Msaccess.exe.
/Pwd <password> Starts Access using the specified password.
You'll be prompted for the path to Msaccess.exe.
/X <macro> Starts Access and runs specified macro.
/Cmd Specifies what value to pass to the Command
function in an Access Basic procedure that is
called by a RunCode action in an AutoExec macro.
This option mus
/Compact <target database> Compacts the database specified before the
/Compact option and then closes Microsoft
Access. To compact to a different name,
specify a target database.
/Repair Repairs the specified database and then
closes Microsoft Access.
/Convert <target database> Converts a version 1.x database to a
version 2.0 database,
with a new name, and then closes Microsoft
Access. Specify the source database before
the /Convert option.
/Profile <user profile> This replaces the /ini option used in
previous versions to specify an
initialization file. The option starts
Microsoft Access using the options
in a specified user profile instead of
the standard Windows Registry settings.
/NoStartup This option starts Microsoft Access without
displaying the startup dialog box.
/Wrkgrp <system filename> You can start Microsoft Access with a
specific workgroup.
/Runtime Starts Microsoft Access in run-time mode.
/Convert <target database> Converts a database in an earlier version
(1.x or 2.0) to a Microsoft Access 95 or
97 database with a new name, and then
closes Microsoft Access. Specify the
source database before the /Convert
option.
c:\access\msaccess.exe Northwind.mdb (or NWIND.MDB in versions 1.x and
2.0) /Excl /X Add Products
/unregserver Forces Microsoft Access to unregister itself and then
exit.
/regserver Forces Microsoft Access to register itself.
For more information about command line switches, search the Help Index for "command-line options," or ask the Microsoft Access 97 Office Assistant.
Additional query words: start up startup
Keywords : kbui UifOthr
Version : 1.0 1.1 2.0 7.0 97
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 27, 1999