Access Development Tips

Table Topics | Queries and Recordsets

Form Tips | Report Topics| Module Code and APIs

General

Open a Database with Access 2, 7 or 8 with a Right Click

Add a Compact Database Option to your Right Click Menu for Access 95 or 97, or a Compact Shortcut on the Desktop


More to Come…. .



















Back to the Tips List

How to Add the Option to Your Right Click Context Menu to Compact an Access Db with any version of Access on your computer.
Similar to the tip regarding adding the option to open a database with a specific version of Access, to add a compact option to your right context menu, you must manually edit the registry on your computer in Windows 95 and NT 4.

1.) Make sure you have a back up copy of your registry, in case of an error.

2.) Open the Registry Editor, and under the key "Hkey_Classes_Root", find the key "Access.Application.X". Where X = the highest version of Access you have installed.

3.) Under this Access.Application.X key click on the "Shell" Key. While Shell is highlighted, use the edit menu item to Add .. NewKey. Call this new key "Compact in Version [2, 95, 97]".

4.) Highlight the new key and repeat the process in item 3 to add another new key below "Compact" and call this key "Command".

5.) Click on the new "Default" entry in the "Command" key and the key value dialog will be displayed. Enter the path to the version of Access used for this compact method on the computer, appending a "%1" at the end, and the adding the command line switch "/compact". Example: "C:\Access\msaccess.exe "%1" /compact".

You should now have the option to compact a database made with that version of Access when you right click on the file.

You can do the same thing with a shortcut item on your desktop, however, for the shortcut command line you must specify the full path to the database, replacing %1. Remember if you are setting this up for an Access 2.x database, you must use the dos shortnames for the database path.



Back to the Tips List

How to Add the option to your Right Click context menu to Open an Access file with any version of Access on your computer.
By default when you install Access 7 or 8 on a computer which has a previous version of Access (1.x or 2.x, or 7) also installed which you want to maintain, all databases with the extension of ".mdb" will be associated with the newer version of Access when you "right click" on the file in Windows Explorer. However, you can, by making minor modifications to your Windows Registry, give yourself the option to open the mdb in either with the appropriate version of Access for which the file was created. (Note any db which has been designed or converted to Access 7 or 8 can't be opened in Access 2).

To accomplish this for a system with Access 2 & 7 or 8 installed, do the following:

  1. Make sure you have a back up copy of your registry, in case of an error.
  2. Open the Registry Editor, and under the key "Hkey_Classes_Root", where X = the highest version of Access you have installed
  3. Under this Access.Application.X key click on the "Shell" Key, and you will find the "Open" key. Rename this key "Open with Access [95 or 97]"
  4. Click again on the "Shell" key so that it is highlighted, and then select "Edit" from the menu, "New", then "Key". After the key is added, name this key "Open with Access 2."
  5. Highlight the new key and repeat the process in item 4 to add another new key below "Open with Access 2" and call this key "Command".
  6. Click on the new "Default" entry in the "Command" key and key value dialog will be displayed. Enter the path to the version of Access 2 on the computer, appending a "%1" at the end. Example: "C:\Access\msaccess.exe %1"

You should now have the option to open any access database on your system with either Access 2 or Access 7 when you right click on the file. Follow the same method again after you install Access 8, using the key Access.Application.8

Back to the Tips List