CDaoQueryDef::GetFieldInfo

Call this member function to obtain various kinds of information about a field defined in the querydef.

void GetFieldInfo( 
   int nIndex, 
   CDaoFieldInfo& fieldinfo, 
   DWORD dwInfoOptions = AFX_DAO_PRIMARY_INFO  
);
void GetFieldInfo( 
   LPCTSTR lpszName, 
   CDaoFieldInfo& fieldinfo, 
   DWORD dwInfoOptions = AFX_DAO_PRIMARY_INFO  
);

Parameters

  • nIndex
    The zero-based index of the desired field in the querydef's Fields collection, for lookup by index.

  • fieldinfo
    A reference to a CDaoFieldInfo object that returns the information requested.

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

    • AFX_DAO_PRIMARY_INFO   (Default) Name, Type, Size, Attributes

    • AFX_DAO_SECONDARY_INFO   Primary information plus: Ordinal Position, Required, Allow Zero Length, Source Field, Foreign Name, Source Table, Collating Order

    • AFX_DAO_ALL_INFO   Primary and secondary information plus: Default Value, Validation Text, Validation Rule

  • lpszName
    A string containing the name of the desired field, for lookup by name. You can use a CString.

Remarks

For a description of the information returned in fieldinfo, see the CDaoFieldInfo structure. This structure has members that correspond to the descriptive information under dwInfoOptions above. If you request one level of information, you get any prior levels of information as well.

Requirements

Header: afxdao.h

See Also

Concepts

CDaoQueryDef Class

CDaoQueryDef Members

Hierarchy Chart

CDaoQueryDef::GetFieldCount