Skip to content

Creating Relationships

While Database Builder can be used to maintain tables, we recommend that you use the Studio to maintain tables during development.

The Relationships tab page of the File Definition dialog displays the table’s relationships to parent tables.

You must open a table in exclusive mode before you can make any changes to the relationship structure. See "Opening a Table" and "Switching Open Modes" for more information.

This tab page is divided into two panels:

  1. Relationships Overview (left panel): This is a treeview structure that displays all current relationships from the table to its parents.
  2. Relationship Details (right panel): This panel displays details of the currently selected relationship in the overview panel.

A splitter between these two panels allows you to adjust the relative widths of each panel.

Relationships Overview

This treeview displays all the relationships from the current table. Below is a guide to the icon symbols used to represent each relationship.

Relationship Node This node is used to indicate a relationship. To the right of this symbol is the name of the parent table being related to. The list of foreign key to primary key columns that participate in the relationship are listed as child nodes. You can expand or collapse the relationship details.

Column Pair Node This node is used to indicate a foreign key/primary key column pair. Each relationship is composed of one or more of these column pairs.

Relationship Details

To view the details of a relationship, first select it in the Relationships Overview. The relationship details panel will display the following information:

From Table

This form displays the name of the table you are editing. This is the child table in the displayed relationship.

To Table

This form displays the parent table of the relationship. You cannot change this value once a relationship has been established. However, you can delete the entire relationship.

If you are creating a new relationship, then the combo list can be used to select a parent table from the list of tables in the database.

From Column/To Column

This is a list of child table foreign key to parent table primary key column pairs. These pairs define the columns that participate in the relationship.

Each foreign key/primary key column pair must have matching column type and length. See Creating Columns.

The following operations can be performed in this list:

  • You can change the 'from column' by selecting a column from the combo list. If a 'to column' has already been selected for this row, then the 'from columns' that are displayed in the list are filtered to columns that match the type and length of the 'to column'.

  • You can change the 'to column' by selecting a column from the combo list. If a 'from column' has already been selected for this row, then the 'to columns' that are displayed in the list are filtered to columns that match the type and length of the 'from column'.

  • You can add a new column pair to the relationship. To add a new column pair, click the 'Add Column Pair' button on the toolbar or simply go to the bottom row of the list and begin selecting columns.

  • You can remove a column pair from the relationship. To remove a column pair, highlight the column pair in the list and click the 'Delete Column Pair' button on the toolbar.

Relationships Toolbar

The relationships tab contains a toolbar which allows you to perform common relationship maintenance operations.

Relationship Wizard

Click this button to activate the Relationships Wizard. This wizard is the fastest and most convenient way to define a new relationship.

For more information, see Relationship Wizard.

Add Relationship

Click this button to start creating a new relationship manually (i.e., without using the Relationship Wizard).

Delete Relationship

Click this button to delete the currently selected relationship.

Add Column Pair

Click this button to add a new child foreign key/parent primary key column pair to the currently selected relationship.

Delete Column Pair

Click this button to delete the currently selected child foreign key/parent primary key column pair from the currently selected relationship.

See Also