The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.



Call this member function to obtain information about a specified relation in the database's Relations collection.

      void GetRelationInfo( 
   int nIndex, 
   CDaoRelationInfo& relinfo, 
void GetRelationInfo( 
   LPCTSTR lpszName, 
   CDaoRelationInfo& relinfo, 


The index of the relation object in the database's Relations collection, for lookup by index.


A reference to a CDaoRelationInfo object that returns the information requested.


Options that specify which information about the relation to retrieve. The available options are listed here along with what they cause the function to return about the relation:

  • AFX_DAO_PRIMARY_INFO   (Default) Name, Table, Foreign Table

  • AFX_DAO_SECONDARY_INFO   Attributes, Field Information

The Field Information is a CDaoRelationFieldInfo object containing the fields from the primary table involved in the relation.


A string containing the name of the relation object, for lookup by name.

Two versions of this function provide access either by index or by name. For a description of the information returned in relinfo, see the CDaoRelationInfo structure. This structure has members that correspond to the items of information listed above in the description of dwInfoOptions. If you request information at one level, you also get information at any prior levels as well.


If you set the relation object's attributes to activate cascade operations (dbRelationUpdateCascades or dbRelationDeleteCascades), the Microsoft Jet database engine automatically updates or deletes records in one or more other tables when changes are made to related primary key tables. For example, suppose you establish a cascade delete relationship between a Customers table and an Orders table. When you delete records from the Customers table, records in the Orders table related to that customer are also deleted. In addition, if you establish cascade delete relationships between the Orders table and other tables, records from those tables are automatically deleted when you delete records from the Customers table.


Header: afxdao.h