Returns information about a client cursor, a transparent server cursor, or an explicit server cursor.
SqlCursorInfoEx%( cursorhandle%, cursorinfo )
where
The SqlCursorInfo structure is defined as follows:
Type SqlCursorInfo TotCols As Long TotRows As Long CurRow As Long TotRowsFetched As Long CursorType As Long Status As Long End Type
The SqlCursorInfo fields are described below:
Field | Description |
---|---|
TotCols | Is the total number of columns in the cursor. |
TotRows | Is the total number of rows in the cursor results set. Client cursor: For a keyset cursor, this number is always valid. For a dynamic cursor, this number is valid only if the current fetch buffer contains the last row in the cursor results set; otherwise, - 1 is returned. Transparent server cursor, explicit server cursor: For a dynamic cursor, - 1 is returned. For a keyset cursor, if the Status field is CU_FILLING, the asynchronous population of the cursor results set is incomplete, and this value indicates the number of rows populated. If the Status field is CU_FILLED, the cursor results set is completely populated, and this value indicates the total number of rows in the cursor results set. |
CurRow | Is the row number within the cursor results set of the current cursor position (first row of the fetch buffer). The first row of the cursor results set is number 1. Client cursor: This value will be 0. Transparent server cursor, explicit server cursor: For a keyset cursor, this value is always valid. For a dynamic cursor, this value will always be 1 when the current position is within the cursor results set. This value will be 0 if the current position is before the beginning of the cursor. This value will be - 1 if the current position is after the end of the cursor. |
TotRowsFetched | Is the total number of valid rows in the current fetch buffer. |
Type | Is a bitmap of cursor type, scroll option, and concurrency control information. It is a series of the following values ORed together: Type: CU_CLIENT: Client cursor CU_SERVER: Transparent server cursor or explicit server cursor Scroll option: CU_DYNAMIC: Dynamic cursor CU_FORWARD: Forward-only dynamic cursor CU_KEYSET: Keyset cursor CU_INSENSITIVE: Insensitive keyset cursor CU_MIXED: Mixed-mode cursor (provided for backward compatibility only) Concurrency control: CU_READONLY: Read-only concurrency CU_LOCKCC: Intent to update concurrency CU_OPTCC: Optimistic concurrency based on timestamp or values CU_OPTCCVAL: Optimistic concurrency based on values |
Status | Bitmap of status information. It is a series of the following values ORed together: Client cursor: CU_FILLED: All cursors Transparent server cursor, explicit server cursor: CU_FILLING: Incomplete asynchronous population of a keyset transparent server cursor or keyset explicit server cursor results set CU_FILLED: Incomplete asynchronous population of a keyset transparent server cursor or keyset explicit server cursor results set, or the cursor is a dynamic cursor |
succeed (1) or fail (0).
Before calling SqlCursorInfoEx%, set the SizeOfStruct field equal to the value returned by the C sizeof function for the SQLCURSORINFO% structure. The SqlCursorInfoEx% function fills the supplied SQLCURSORINFO% structure with information about the open server cursor.
SqlCursor%, SqlCursorClose, SqlCursorColInfo%, SqlCursorFetch%, SqlCursorInfoEx%, SqlCursorOpen%