Platform SDK: MAPI

Retrieving Data from Table Rows

Retrieving rows from a table involves:

One of the required columns in most tables is an entry identifier — or PR_ENTRYID property — that can be used to open the object that represents the row. This entry identifier is usually a short-term entry identifier, one that does not persist past the lifetime of the table. However, it can be a long-term identifier if the service provider implementing the table only supports one type of entry identifier.

Clients and service providers can make one of the following calls to retrieve rows:

IMAPITable::QueryRows Retrieves a specified number of rows starting with the current row in either a forward or backward direction.
HrQueryAllRows Retrieves all of the rows in a table.
ITableData::HrQueryRow Retrieves a row in a table according to the value of its index column. PR_INSTANCE_KEY is usually the index column for a table.

When an optional property is included as one of the columns in a table, some of the rows might have valid values for the column while others might not. Whether or not a valid value exists for a column depends on whether or not the object providing the information for the row sets the property. Depending on the implementation of the object, a non-existent property can be represented in the table as PR_NULL or an arbitrary value. Users of tables must be careful to differentiate between properties that are nonexistent and have meaningless values and properties that do exist and have valid values.