Uredi

Deli z drugimi prek


CDaoRelationFieldInfo Structure

The CDaoRelationFieldInfo structure contains information about a field in a relation defined for data access objects (DAO).

Note

Data Access Objects (DAO) is supported through Office 2013. DAO 3.6 is the final version, and it's considered obsolete.

Syntax

struct CDaoRelationFieldInfo
{
    CString m_strName;           // Primary
    CString m_strForeignName;    // Primary
};

Parameters

m_strName
The name of the field in the primary table of the relation.

m_strForeignName
The name of the field in the foreign table of the relation.

Remarks

A DAO relation object specifies the fields in a primary table and the fields in a foreign table that define the relation. The references to Primary in the structure definition indicate how the information is returned in the m_pFieldInfos member of a CDaoRelationInfo object obtained by calling the GetRelationInfo member function of class CDaoDatabase.

Relation objects and relation field objects aren't represented by an MFC class. Instead, the DAO objects underlying MFC objects of class CDaoDatabase contain a collection of relation objects, called the Relations collection. Each relation object, in turn, contains a collection of relation field objects. Each relation field object correlates a field in the primary table with a field in the foreign table. Taken together, the relation field objects define a group of fields in each table, which together define the relation. CDaoDatabase lets you access relation objects with a CDaoRelationInfo object by calling the GetRelationInfo member function. The CDaoRelationInfo object has a data member, m_pFieldInfos, that points to an array of CDaoRelationFieldInfo objects.

Call the GetRelationInfo member function of the containing CDaoDatabase object in whose Relations collection is stored the relation object you're interested in. Then access the m_pFieldInfos member of the CDaoRelationInfo object. CDaoRelationFieldInfo also defines a Dump member function in debug builds. You can use Dump to dump the contents of a CDaoRelationFieldInfo object.

Requirements

Header: afxdao.h

See also

Structures, Styles, Callbacks, and Message Maps
CDaoRelationInfo Structure