CDaoTableDef::GetRecordCount

long GetRecordCount( );
throw( CDaoException, CMemoryException );

Return Value

The number of records accessed in a tabledef object.

Remarks

Call this member function to find out how many records are in a CDaoTableDef object.

Calling GetRecordCount for a table-type CDaoTableDef object reflects the approximate number of records in the table and is affected immediately as table records are added and deleted. Rolled back transactions will appear as part of the record count until you call CDaoWorkSpace::CompactDatabase. A CDaoTableDef object with no records has a record count property setting of 0. When working with attached tables or ODBC databases, GetRecordCount always returns  –1.

For more information on tabledefs, see the articles DAO Tabledef and DAO Tabledef: Using Tabledefs in Visual C++ Programmer's Guide. For related information, see the topic "RecordCount Property" in DAO Help.

CDaoTableDef OverviewClass MembersHierarchy Chart

See Also   CDaoTableDef::GetSourceTableName, CDaoTableDef::SetSourceTableName