Relation Tab (Command Properties Dialog Box)

The Command Properties dialog box is divided into six tabs. The General, Parameters, and Advanced tabs are used for setting properties of the Command and Parameter objects, while the Relation, Grouping, and Aggregates tabs are used for setting properties that are specific to Command hierarchies.

On the Relation tab, specify the properties for a relation hierarchy.

Note   The properties on this tab do not apply to Visual InterDev.

Relate to a Parent Command Object

If selected, the current Command object is the child in a relation hierarchy, and all controls on the tab are enabled. If not selected, the Command object is not the child in a relation hierarchy, and all controls on the tab are disabled.

Parent Command

The Command object that is the parent to the child Command object. This can be any Command object that is associated with the same Connection object.

Relation Definition

This frame contains the control group that defines the Field and Parameter objects that specify the relationship between two Command objects. For example, if one Command object returns data from an Orders table and another returns data from a Customers table, you should use a field that exists in both tables, such as orderID.

Note   You must link all required Parameter objects to the parent Command object. If the required parameters are not linked, an error occurs when you attempt to close the Command Properties dialog box.

The Relation Definition list shows the current definitions of Parent Field TO Child Field/Parameters.

Parent Fields

This drop-down list contains the Field objects of the parent Command object. When added, these show on the left side of the relate expression in the Relation Definition list.

Child Fields/Parameters

This drop-down list contains the Parameter or Field objects of the child Command object. The Child Fields/Parameters, when added, are used on the right of the relate expression in the Relation Definition. If the child Command object has input parameters, these parameters are listed first, and if these parameters are required, they must be related to fields in the parent object.

Note   An error occurs if you attempt to exit the Command Properties dialog box and the required parameters do not have links set to parent fields.

Add

Click Add to create a new relation definition based on the contents of the Parent Field and Child Field/Parameters lists. The new relation shows in the Relation Definition list (for example, CustomerID TO CustomerID).

Note   You can add more than one relation definition within each hierarchical relationship.

Remove

Select a relation from the Relation Definition list, and then click Remove to delete it.

Note   There is no undo mechanism. Therefore, if the wrong relation is removed, it must be added again using the Add feature.