CDaoTableDef::CreateIndex
Call this function to add an index to a table.
void CreateIndex(
CDaoIndexInfo& indexinfo
);
Parameters
- indexinfo
A reference to a CDaoIndexInfo structure.
Remarks
Indexes specify the order of records accessed from database tables and whether or not duplicate records are accepted. Indexes also provide efficient access to data.
You do not have to create indexes for tables, but in large, unindexed tables, accessing a specific record or creating a recordset can take a long time. On the other hand, creating too many indexes slows down update, append, and delete operations as all indexes are automatically updated. Consider these factors as you decide which indexes to create.
The following members of the CDaoIndexInfo structure must be set:
m_strName A name must be supplied.
m_pFieldInfos Must point to an array of CDaoIndexFieldInfo structures.
m_nFields Must specify the number of fields in the array of CDaoFieldInfo structures.
The remaining members will be ignored if set to FALSE. In addition, the m_lDistinctCount member is ignored during creation of the index.
Requirements
Header: afxdao.h