Udostępnij za pośrednictwem


CDaoTableDef::GetFieldInfo

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

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 index of the field object in the table's zero-based Fields collection, for lookup by index.

  • fieldinfo
    A reference to a CDaoFieldInfo structure.

  • 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. Use this option for fastest performance.

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

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

  • lpszName
    A pointer to the name of the field object, for lookup by name. The name is a string with up to 64 characters that uniquely names the field.

Remarks

One version of the function lets you look up a field by index. The other version lets you look up a field by name.

For a description of the information returned, see the CDaoFieldInfo structure. This structure has members that correspond to the items of information listed above in the description of dwInfoOptions. When you request information at one level, you get information for any prior levels as well.

For related information, see the topic "Attributes Property" in DAO Help.

Requirements

Header: afxdao.h

See Also

Reference

CDaoTableDef Class

Hierarchy Chart

CDaoTableDef::GetIndexInfo

CDaoTableDef::GetIndexCount

CDaoTableDef::GetFieldCount

Other Resources

CDaoTableDef Members