Synopsis:
adoRSetMove(handle,numrec[,start])
Arguments:
handle - The recordset handle.
numrecs - The number of records to move the record pointer (negative value moves backwards).
[start] - Optional flag to indicate the start position of the move (default is to move relative to current position).
Description: This function moves the record pointer in a recordset (specified by handle) a certain number of records as specified by numrecs, forward or backwards through the data relative to a start position specified by the optional start argument. If a positive value for numrecs is specified then the function will move the record pointer forward in the recordset, if a negative value is specified the the record pointer will attempt to move backwards in the recordset.
The optional start argument indicated the starting position, relative to which the record pointer will be moved. This can be set to a bookmark offset position (see adoRSetParmGet(P_RS_BOOKMARK) ) or one of the following constants defined in ado.inc :
|
Constant |
Value |
Description |
|
adBookmarkCurrent |
0 |
Starts at the current record (default) |
|
adBookmarkFirst |
-1 |
Starts at the first record |
|
adBookmarkLast |
-2 |
Starts at the last record |
Technical Note: the above constants differ from the underlying equivalent enumeration values used by ADO, as they have been made negative so that they can be distinguished from a valid bookmark value. In the underlying ADO library, the a VARIANT data type is used to make this distinction (bookmarks are type R8, enums are I4). however since the Telecom Engine deals with string types for variables the above constants have been made negative in order to make this same distinction.
If the Move call would move the current record position to a point before the first record, ADO sets the current record to the position before the first record in the recordset (BOF is set to True). An attempt to move backward when the BOF property is already True generates an error.
If the Move call would move the current record position to a point after the last record, ADO sets the current record to the position after the last record in the recordset (EOF is set to True). An attempt to move forward when the EOF property is already True generates an error.
Calling the Move method from an empty Recordset object generates an error.
Use adoRSetIsBOF() and adoRSetIsEOF() to test these conditions.
Returns: Returns 0 upon success or a negative error code. If ADOERR_COMERR is returned, then the underlying ADO error can be obtained by calling adoLastError()