This documentation is archived and is not being maintained.

Determining a Table's End

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

A common error is to assume that the end of the table has been reached when:

  • IMAPITable::QueryRows has been called in a loop, with the end of the loop determined by the row count returned by IMAPITable::GetRowCount. The count that GetRowCount returns does not always represent the exact number of rows in the table; it is an approximate count.

  • QueryRows has been called with a fixed number of rows and fewer rows are returned. It is not until QueryRows returns a row set with a row count equal to zero that there are no more rows to retrieve.

Important noteImportant

The only time that a caller can assume that the cursor is positioned at the end of the table for a positive row count or at the beginning of the table for a negative row count is when the value S_OK and zero rows are returned. The value MAPI_E_NOT_FOUND is never returned.