CDaoIndexFieldInfo Structure

CDaoIndexFieldInfo Structure


The CDaoIndexFieldInfo structure contains information about an index field object defined for data access objects (DAO).

struct CDaoIndexFieldInfo{   CString m_strName;          // Primary   BOOL m_bDescending;         // Primary};


Uniquely names the index field object. For details, see the topic "Name Property" in DAO Help.


Indicates the index ordering defined by the index object. TRUE if the order is descending.

An index object can have a number of fields, indicating which fields a tabledef (or a recordset based on a table) is indexed on. The references to Primary above indicate how the information is returned in the m_pFieldInfos member of a CDaoIndexInfo object obtained by calling the GetIndexInfo member function of class CDaoTableDef or CDaoRecordset.

Index objects and index field objects are not represented by an MFC class. Instead, the DAO objects underlying MFC objects of class CDaoTableDef or CDaoRecordset contain a collection of index objects, called the Indexes collection. Each index object, in turn, contains a collection of field objects. These classes supply member functions to access individual items of index information, or you can access them all at once with a CDaoIndexInfo object by calling the GetIndexInfo member function of the containing object. The CDaoIndexInfo object, then, has a data member, m_pFieldInfos, that points to an array of CDaoIndexFieldInfo objects.

Call the GetIndexInfo member function of the containing tabledef or recordset object in whose Indexes collection is stored the index object you are interested in. Then access the m_pFieldInfos member of the CDaoIndexInfo object. The length of the m_pFieldInfos array is stored in m_nFields. CDaoIndexFieldInfo also defines a Dump member function in debug builds. You can use Dump to dump the contents of a CDaoIndexFieldInfo object.


Header: afxdao.h

© 2015 Microsoft