CDaoDatabase::GetRelationInfo

void GetRelationInfo( int nIndex, CDaoRelationInfo& relinfo, DWORD dwInfoOptions = AFX_DAO_PRIMARY_INFO );
throw( CDaoException, CMemoryException );

void GetRelationInfo( LPCTSTR lpszName, CDaoRelationInfo& relinfo, DWORD dwInfoOptions = AFX_DAO_PRIMARY_INFO );
throw( CDaoException, CMemoryException );

Parameters

nIndex

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

relinfo

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

dwInfoOptions

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:

lpszName

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

Remarks

Call this member function to obtain information about a specified relation in the database’s Relations collection. 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.

Note   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.

For more information about database objects, see the article DAO Database in Visual C++ Programmer's Guide.

CDaoDatabase OverviewClass MembersHierarchy Chart

See Also   CDaoDatabase::GetRelationCount