2.2.3.12 CPMGetRowsOut

The CPMGetRowsOut message replies to a CPMGetRowsIn message with the rows of a query. Servers MUST format offsets to variable length data types in the row field as follows:

  • The client indicated that it was a 32-bit system (_iClientVersion less than 0x00010000 in the _iClientVersion field of CPMConnectIn), and the serverĀ  indicated that it was a 32-bit system (_serverVersion less than 0x00010000 in CPMConnectOut). Offsets are 32-bit integers.

  • The client indicated that it was a 64-bit system (_iClientVersion greater than 0x00010000 in CPMConnectIn), and the server indicated that it was a 32-bit system (_serverVersion less than 0x00010000 in CPMConnectOut). Offsets are 32-bit integers.

  • The client indicated that it was a 32-bit system (_iClientVersion less than 0x00010000 in the _iClientVersion field of CPMConnectIn), and the server indicated that it was a 64-bit system (_serverVersion greater than 0x00010000 in CPMConnectOut). Offsets are 32-bit integers.

  • The client indicated that it was a 64-bit system (_iClientVersion greater than 0x00010000 in CPMConnectIn), and the server indicated that it was a 64-bit system (_serverVersion greater than 0x00010000 in CPMConnectOut). Offsets are 64-bit integers.

The format of the CPMGetRowsOut message that follows the header is shown in the following diagram.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

_cRowsReturned

eType

_chapt

SeekDescription (variable)

...

paddingRows (variable)

...

Rows (variable)

...

_cRowsReturned (4 bytes): A 32-bit unsigned integer indicating the number of rows returned in Rows.

eType (4 bytes): A 32-bit unsigned integer. MUST contain one of the following values indicating the point at which to begin retrieving rows.

Value

Meaning

eRowsSeekNone

0x00000000

The SeekDescription is absent.

eRowSeekNext

0x00000001

SeekDescription contains a CRowSeekNext structure.

eRowSeekAt

0x00000002

SeekDescription contains a CRowSeekAt structure.

eRowSeekAtRatio

0x00000003

SeekDescription contains a CRowSeekAtRatio structure.

eRowSeekByBookmark

0x00000004

SeekDescription contains a CRowSeekByBookmark structure.

_chapt (4 bytes): A 32-bit value representing the handle of the rowset chapter.

SeekDescription (variable): This field MUST contain a structure of the type indicated by the eType field.

paddingRows (variable): This field MUST be of sufficient length (0 to _cbReserved -1 byte) to pad the Rows field to _cbReserved offset from the beginning of a message, where _cbReserved is the value in the CPMGetRowsIn message. Padding bytes used in this field can be any arbitrary value. This field MUST be ignored by the receiver.

Rows (variable): Row data is formatted as prescribed by column information in the most recent CPMSetBindingsIn message. Rows MUST be stored in forward order (for example, row 1 before row 2).

Fixed-sized columns MUST be stored at the offsets specified by the most recent CPMSetBindingsIn message.

Variable-sized columns (for example, strings) MUST be stored as follows:

  • The variable data itself (for example, the string) is stored near the end of the buffer in descending order (for example, the collection of all variable data for row 1 is at the end, row 2 next closest, and so on).

  • The fixed-sized area (at the beginning of the row buffer) MUST contain a CTableVariant for each column, stored at the offset specified in the most recent CPMSetBindingsIn message. vType MUST contain the data type (for example, VT_LPWSTR). If, as determined by the rules at the beginning of this section, 32-bit offsets are being used, the Offset field in CTableVariant MUST contain a 32-bit value that is the offset of the variable data from the beginning of the CPMGetRowsOut message, plus the value of _ulClientBase specified in the most recent CPMGetRowsIn message. If 64-bit offsets are being used, the Offset field in CTableVariant MUST contain a 64-bit value that is the offset from the beginning of the CPMGetRowsOut message, added to a 64-bit value composed by using _ulClientBase as the low 32-bits and _ulReserved2 as the high 32-bits.

The buffer is filled in from both ends. CTableVariant structures, one for each row, are stored at the beginning of the buffer. Each of these structures points to the row data which is stored starting at the end of the buffer.

Structure of the row buffer

Figure 3: Structure of the row buffer