Friday, February 26, 2016

Compact-Repair Shortcut

Desktop convenience

You can make compacting and repairing databases easier by providing a desktop shortcut.

Right-click on the Windows desktop and select New>Shortcut from the shortcut menu. Then, set up a Command Line entry in the form:

"Path to Access.exe" "Path to Database.mdb" /compact

For example, to create a shortcut to compact Northwind, you might use:

"C:\Program Files\Microsoft Office\Office\Msaccess.exe" "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb" /compact

Click Next and continue through the shortcut setup wizard, naming the shortcut appropriately.

In Access 2000+, the database is both compacted and repaired when the /compact switch is applied.

Access 97 executes these processes separately, so Access 97 shortcuts should use a Command Line in the form:

"Path to Access" "Path to Database" /compact /repair

Also note that you can compact to a different location by specifying a target database name after the /compact switch.

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.

(Even though a shortcut will open the database without it, in order for the command line flag to work, you MUST include the path to the executable - Access.exe)

See all Topics

No comments: