If the user has chosen the option of creating a user key for the EDB layer (see chapter 41 “Main EDB components”, subsection “Creating an EDB layer”) then at the second step of the link creating wizard the radio button Link by user key can be selected (figure 43-14).
Figure 43-14. Link creating wizard for EDB layer's features, page “Selecting link mode”
In this case, setting of link fields is to be carried out at the next step of the wizard. This step is illustrated at the figure 43-15. It is similar to setting of indirect link fields which is described in the subsection “Creating indirect link” and is illustrated at the figure 43-7. Fields of the user key play a part similar to fields of the cross table used for indirect link.
Figure 43-15. Link creating wizard for EDB layer's features, page “Setting fields for linking by user key”
The setting is forming a set of link fields of the EDB table/query. It is necessary to associate a field of compatible type from the user key with each of these link fields.
The lower part of the page displays a list of all fields of EDB table or query being linked. When the user chooses one of these fields, fields of user key compatible with it by the type are displayed on the right.
Pushing the button
causes transfer of selected pair of fields into the upper pane, where a list of selected fields of indirect link is displayed. The button
allows excluding the selected pair of fields from the list.
At the fourth step of the wizard the user should choose mode of linking and mode of unlinking. These modes indicate which operations should be performed with values of the link fields of the table being linked and of the user key when the link between the record of EDB table and the feature is set or broken. In the given case the corresponding page of the wizard looks like it is shown at figure 43-16.
Figure 43-16. Link creating wizard for EDB layer's features, page “Modes of linking and unlinking” for link by user key
Setting of link between a feature and a table record actually means assigning values of the record fields to the corresponding fields of user key. Additional actions are determined by the state of a checkbox:
Check existence of linked record – if the box is checked then before setting link of a feature with a record ObjectLand checks existence of a record in the EDB table/query which is already linked with this feature (i.e. it checks existence of a record with values of link fields equal to the values of corresponding fields of user key for the feature). In such a case a new link is not set. By default, this box is not checked, i.e. the existing link of the feature with a record will be broken, and a new link with another record will be set instead.
Unlinking means that fields of user key and fields of the linked table record should give different values. Specific actions performed for this purpose depend on two checkboxes:
Put NULL into link fields in table – on breaking link of a record with a feature, empty values (NULL) are put into link fields of the table/query.
Put NULL into user key fields in layer – on breaking link of a record with a feature, empty values (NULL) are put into link fields of the user key for the given feature.
If NULL values are not supported by the data source of the EDB, then zero values are used instead.
At least one of the two boxes should be checked, because if not, it would be impossible to break a link. By default the box of putting NULL values is checked.
The given step of the wizard is the last one for the case of link by user key. After pushing the button Finish the link between a feature type of an EDB layer and a table or query of the same EDB is created. At the property page “Links” of the feature type the link by user key is indicated by the sign
(figure 43-17).
Figure 43-17. Scheme of links of feature type of EDB layer with a link by user key