Name

Recordset.goto — jump to a particular row in a recordset

Synopsis

void Recordset.goto ( row);  
int   row;

Description

Moves the cursor to a particular row in the recordset. The row number is given as a zero based index in row. If row is out of range (either less than zero or greater than or equal to the total number of rows in the recordset) then the result is undefined, and may well have an adverse effect on future operations on the recordset.

Example 69. Recordset.goto Example

// Get the first and last records from a recordset
rs.goto(0);

// Do something

rs.goto(rs.rows() - 1);

// Do something

rs.close();

See Also

Data sources and database access in RSP is explained in the section called “Accessing Databases”