3.2.5.5 Processing RopQueryRows

When a RopQueryRows ROP request ([MS-OXCROPS] section 2.2.5.4) is sent, the server MUST send the rows from the table starting at the current cursor position.

The number of rows sent in the ROP response MUST be less than or equal to the number of rows specified in the RowCount field. The number of rows sent in the response MUST be as many rows as can fit in the ROP response buffer. Whole rows MUST always be sent (partial rows MUST NOT be sent). If there are rows to send in the database, at least one row MUST be returned or the ROP MUST fail with "ecBufferTooSmall", as specified in [MS-OXCDATA] section 2.4. This ROP MUST only send zero rows when there are no more rows in the table.

The Origin field in a successful ROP response will have one the predefined values specified in section 2.2.2.1.1. If there are no more rows to return and the ForwardRead field in the ROP request is set to "TRUE", then the Origin field is set to "BOOKMARK_END". If there are no more rows to return and the ForwardRead field in the ROP request is set to "FALSE", then the Origin field SHOULD<25> be set to "BOOKMARK_BEGINNING". Otherwise, it will be set to "BOOKMARK_CURRENT".

If rows are returned by the RopQueryRows ROP and the ForwardRead field is set to "TRUE" (0x01), the RopQueryRows ROP returns the rows beginning at the position pointed to by the Origin field, reading forward. If it is set to "FALSE" (0x00), the server returns the rows starting at the number of rows equal to the value of the RowCount field before the position pointed to by the Origin field, such that the rows returned are those between the value of the Origin field minus the value of the RowCount field and the position pointed to by the Origin field.

If the NoAdvance flag (0x01) is set in the QueryRowsFlags field, the server MUST NOT change the position of the cursor.

The RopSetColumns ROP ([MS-OXCROPS] section 2.2.5.1) MUST be sent on the table before sending a RopQueryRows ROP request. The columns sent in the response for each row MUST be the ones specified on the RopSetColumns ROP request. The server MUST complete all asynchronous table ROPs before executing this ROP or fail the ROP with "ecBusy", as specified in section 3.2.5.1.

The RopQueryRows ROP MUST be supported for all types of tables.

The following specific error codes apply to this ROP. For more details about ROP errors returned, see [MS-OXCDATA] section 2.4.

Error code name

Value

Description

ecNullObject

0x000004B9,

%xB9.04.00.00

RopSetColumns has not been sent on this table.

ecNotSupported

0x80040102,

%x02.01.04.80

The object on which this ROP was sent is not of type table.

ecBufferTooSmall

0x0000047D,

%x7D.04.00.00

The space allocated in the return buffer is insufficient to fit at least one row of data.