Search
Table.AddRelation Method
See Also
 



Creates a relation to another table.

 Syntax

VB6  Copy Code

Public Function AddRelation( _
    ByVal row As Long, _
    ByVal rel As ERelationship, _
    ByVal pTable As Table, _
    ByVal relRow As Long _
) As Arrow

C++  Copy Code

public:
Arrow* AddRelation (
    int row,
    ERelationship rel,
    Table* pTable,
    int relRow
)

 Parameters

row
The index of the origin row in the current table.
rel

A member of the ERelationship enumeration specifying the type of the relation - either rlOneToMany or rlManyToOne.

pTable

The other table in the relation.

relRow

The index of the destination row in pTable.

 Return Value

A reference to an arrow object; this is the arrow representing the relationship between two tables.

 Remarks

Creates an arrow, connecting a row of the table-object passed as argument (pTable) to a row of the table-object on which the method is called. These rows could visually represent table fields in entity-relationship diagrams. The direction of the arrow depends on the rel argument, which can be one of these:

  • rlOneToMany - the arrow points to the table-object on which the method is called;
  • rlManyToOne - the arrow points to pTable;

You can create many arrows connected to a single row of table.

 See Also