Compact Your Database with a Right-Click

Window 95
Windows 2000

This tip shows you how to compact a database with a click of your mouse. When you use your mouse, you should notice that while the left mouse button selects items, the right mouse button opens menu options. This tip will show you how to add a right-click option to compact a database. To use this new feature, you would navigate to your database in Windows Explorer or My Computer - then you would right-click on the file and choose 'compact database'. Follow the instructions listed to make this possible.

Windows 95

  1. Open Windows Explorer.
  2. Click Tools - Folder Options...
  3. On the Folder Options window, click the File Types tab.
  4. From the 'Registered file types' file list, find 'Microsoft Access Database' and click it once to select it. (Under 'File type details' in the lower half of the window, the 'Extension' should read MDB.)
  5. Click the Edit button.
  6. Click the New... button.
  7. In the 'New Action' window, under 'Action:', type a name like 'Compact Database'.
  8. Now click the Browse... button.
  9. A new window will open called 'Open With'.
    Navigate to C :\Program Files\Microsoft Office\Office\msaccess.exe.
  10. Click on msaccess.exe - then click on Open.
  11. Under 'Application used to perform action:', you will now see the path to Microsoft Access. At the end of that line, type: "%1" /compact
    The line should look like this:

  1. Click OK.

Now if you want to compact a database, all you have to do is right-click on a database file in Windows Explorer or My Computer - and choose Compact Database.

Please note that you may use the same method to enable the "Repair" utility. To do so, follow the steps shown above, but substitute the word "repair" for the word "compact". For step 11 above, then, at the end of the line, one would type  "%1" /repair

 

Windows 2000

  1. Open Windows Explorer.
  2. Click Tools - Folder Options...
  3. On the Folder Options window, click the File Types tab.
  4. From the 'Registered file types' file list, find the 'MDB' extension - File Type 'Microsoft Access Database' and click it once to select it.
  5. Click the Advanced button.
  6. Click the New... button.
  7. In the 'New Action' window, under 'Action:', type a name like 'Compact Database'.
  8. Now click the Browse... button.
  9. (continued on next page . . . )

  10. A new window will open called 'Open With'.
    Navigate to C:\Program Files\Microsoft Office\Office\msaccess.exe.
  11. Click on msaccess.exe - then click on Open.
  12. Under 'Application used to perform action:', you will now see the path to Microsoft Access. At the end of that line, type: "%1" /compact
    The line should look like this:

  1. Click OK.

Now if you want to compact a database, all you have to do is right-click on a database file in Windows Explorer or My Computer - and choose Compact Database.

Please note that you may use the same method to enable the "Repair" command line option. To do so, follow the steps shown above, but substitute the word "repair" for the word "compact". For step 11 above, then, at the end of the line, one would type  "%1" /repair

From a user point of view, there appears to be no difference in the operation of these two command line options (/compact and /repair) in Access 2000. Both report that they are "compacting" the database. That the two functions of Access 97 are combined in the pull-down menus of the full version of Access 2000 also suggests that only one step is required to accomplish both purposes in the newer package.