Auxiliary Databases

Many times multiple separate databases are required to accomplish a database task. For example, if you are working with an Invoice database, perhaps you also need to have the Inventory, Customer List and Price List databases open. You can ask Panorama to open these auxiliary databases automatically by opening the File>Database Options dialog sheet and switching to the Auxiliary panel. This illustration shows an Invoice database with three auxiliary databases.

With this configuration, whenever the Invoice database is opened, the Customer List, Price List and Inventory databases will also open. This happens completely automatically, there is no need for any additional code. (Note, however, that this is a one way link. In this example, opening the Invoice database will open the other databases, but opening one of these other databases will not open the Invoice database. You can, however, set up the Auxiliary panel on these other databases so that opening any database in the set will open up all of the databases.)

### Adding a Database to the Auxiliary Panel

There are three ways a database can be added to the Auxiliary panel: by dragging from the window title of an open database, by dragging from the Finder, or by pressing the + button and choosing the database with a dialog.

Usually the easiest method is to drag the icon from the window title of an open database. Note: When you click on the icon, you have to pause for a short time before dragging it to the Auxiliary panel.

Another method is to drag the database icon from the Finder into the panel, like this:

The final method is to press the + icon, then choose the database from the file selection dialog, like this:

When all the auxiliary files are added, press the Ok button to save this configuration. From now on, whenever this database is opened, the auxiliary databases will open automatically as well. (Note: Of course you can add more auxiliary databases at any time if needed.)

For shared databases, you must create a New Generation (with Field Arrangement and Data Types selected) and upload that to distribute the setting to other users. They will receive the change the next time they open the database.

### Removing and Rearranging Auxiliary Databases

To remove an auxiliary database, click on the red minus sign icon to the right of the database name.

To rearrange the order of the auxiliary databases, click and drag on the hamburger icon to the left of the database name.

Panorama will open the databases in the order listed.

### Database Path

In the examples shown so far, both the primary database and the auxiliary databases have been in the same folder. This is the most common situation, but it’s not required, an auxiliary database can be anywhere on your hard drive. When an auxiliary database is in the same folder as the primary database (or in a subfolder of the same folder), the folder icon in the Auxiliary panel is displayed in green.

Whenever possible, we recommend keeping the primary and auxiliary databases in the same folder. When this is done, you can move the databases to another folder and they will all still open automatically. You can even move them to another computer and the auxiliary databases will continue to work without any adjustment (as long as you keep the primary and auxiliary databases together in the same folder).

If an auxiliary database is not in the same folder as the primary database, the folder icon will not be green. Most commonly, the icon will be purple, indicating that Panorama is keeping track of the location of the auxiliary database using Apple’s “bookmark” feature. By using the “bookmark” feature, Panorama can still automatically open the auxiliary database even if it has been moved or renamed. (However, it will not work if the databases are moved to a different computer.)

#### Manually Choosing the Path Type

Panorama normally automatically chooses how it will keep track of the auxiliary database location, either in the same folder or a subfolder (green), or using a bookmark (purple). You can also manually override this choice, and also pick from two other options. Click on the folder icon to manually choose the type of path.

- Relative to database – This is the default choice if the auxiliary database is in the same folder as the primary database, or a subfolder. If the auxiliary database is in some other folder then this option will be dimmed.

- Relative to user folder – This option is available if the auxiliary database is in your user folder. This could be useful if you wanted to keep an auxiliary database in a fixed location in your account, for example the ~/Documents folder or the ~/Library/Application Support/ folder. If you ever wanted to copy the primary database to another user, you would just have to make sure that you also copied the auxiliary databases to the same folder within their user folder. If the auxiliary database is not inside your user folder (for example if it is on an external drive) then this option will be dimmed. If the Relative to user folder option is in use the folder icon will be blue.

- Absolute Path – This option is always available, even if the auxiliary database is located on an external drive. This option is usually not a good choice if you think you might ever move the primary database to another computer. If you ever move the auxiliary database, the absolute path will break (in that case, you would have to remove and then re-add the auxiliary database). If the Absolute Path option is in use the folder icon will be orange.

- Bookmark – This option is always available, even if the auxiliary database is located on an external drive. This option is usually not a good choice if you think you might ever move the primary database to another computer. Unlike the Absolute Path option, a path saved as a bookmark will not break if you later move or even rename the auxiliary file. It will break, however, if you move the databases to another computer (in that case, you would have to remove and then re-add the auxiliary database).

### Opening an Auxiliary Database “Secretly”

Panorama usually opens auxiliary databases with their normal windows. In some situations you may want to open an auxiliary database without any windows, for example if you just want to use the database for lookups. To accomplish this, click on the folder and check the Open with no Windows option.

Note: The `.Initialize` procedure (if any) does not run if the database is opened secretly.

When this option is enabled, an icon of an eye with a slash through it appears after the database name.

If you later decide you want to make this database visible, you can use the opensheet, openform or opensavedwindows statements. See the opensecret statement to learn more about how Panorama opens a database with no windows.

### Checking an Auxiliary Database Path

To check the location of an auxiliary database, click on the folder icon and choose one of the last two options from the popup menu:

- Copy Path to Clipboard copies the absolute path of the database to the clipboard.
- Reveal in Finder opens the folder containing the database in the Finder.

See Also

- closefile -- closes the current database.
- closeserverfile -- closes the current database (used on the server).
- Custom Database Initialization -- using an .Initialize procedure to automatically run custom code when a database opens.
- Database Integrity Checks -- checking database integrity when opening and saving.
- Database is Damaged Alert -- how to fix the "database is damaged" alert when opening a database.
- opendatabase -- opens a database file.
- openfile -- opens a database file. It can also import data from a text file, another database, or a variable into the current database.
- opensavedwindows -- opens windows that were open the last time file was saved.
- opensecret -- opens a database invisibly, without opening its windows.
- openserverfile -- opens a database (used on the server).
- opentextfile -- imports data from a text file or a variable into the current database.
- panoramastartupdatabases -- opens any databases specified for startup.

History

Version | Status | Notes
10.2 | New | New in this version.