3.1.5.2.11 Receiving a CPMCompareBmkIn Request

When the server receives a CPMCompareBmkIn message request from the client, the server MUST do the following:

  1. Check whether the client has a query associated with it. If this is not the case, the server MUST report a STATUS_INVALID_PARAMETER (0xC000000D) error.

  2. Check whether the cursor handle, chapter handle, and bookmark handle passed are in corresponding lists. If this is not the case, the server MUST report an E_FAIL (0x80004005) error.

  3. Prepare a CPMCompareBmkOut message.

  4. If bookmark handles are equal, _dwComparison MUST be set to DBCOMPARE_EQ.

  5. Otherwise, the server MUST do the following:

    1. Find rows that are referred to by each bookmark handle in the query results. If the server cannot find one of the rows, DB_E_BADBOOKMARK (0x80040E0E) is returned.

    2. If any one of the rows is not in the chapter indicated by the chapter handle in CPMCompareBmkIn, then _dwComparison MUST be set to DBCOMPARE_NOTCOMPARABLE.

    3. Otherwise, when both rows are in the same chapter, the server MUST approximate a position of those rows in the rowset referred to by this chapter's handle. The server MUST then compare position values and set _dwComparison to DBCOMPARE_LT if the position of the first row is smaller than the position of the second row; otherwise, _dwComparison MUST be set to DBCOMPARE_GT.

  6. Respond to the client with filled CPMCompareBmkOut message.