• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

15. Programming DAO: Data Definition Language > 15.5. Creating a Relation

Creating a Relation

Relations are created in DAO using the CreateRelation method. The syntax is:

SetRelationVar = DatabaseVar.CreateRelation _
([RelName[, KeyTable[, ForeignTable[, Attributes]]]])

where:

  • RelName is the name of the new relation.

  • KeyTable is the name of the referenced table in the relation (containing the key).

  • ForeignTable is the name of the referencing table in the relation (containing the foreign key).

  • Attributes is a constant, whose values are shown in Table 15-2.

Table 15-2. Attributes for a Relation object

Constant

Description

dbRelationUnique

Relationship is one-to-one

dbRelationDontEnforce

No referential integrity

dbRelationInherited

Relationship exists in a noncurrent database that contains the two attached tables


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint