Home > Language Reference > Database Functions > DbMove

DbMove

The DbMove function moves the read pointer to the specified record for the recordset in use.

Syntax

ret=DbMove(<pos>)

Parameters

<pos>, integer specifying how many records the read pointer must move to get to the desired record. A positive value moves the pointer toward the end of the recordset, a negative value moves the pointer toward the beginning of the recordset.

Return value

ret, optional numeric return value. If the function succeeds, the return value is 0. If the function fails, the return value is a nonzero value (see Error Codes for Database Functions).

See also

DbBof
DbClose
DbConnect
DbDisconnect
DbEof
DbExecute
DbGetFieldNumeric
DbGetFieldString
DbMoveFirst
DbMoveLast
DbMoveNext
DbMovePrev
DbRecordCount
DbSelect

Example

'The example uses a data source name called DBTest which contains those records in a table called DATA:
' a,1, 1.23, 02/01/2011
' b,2, 2.34, 03/02/2012
' c,3, 3.45, 04/12/2009
DbConnect("DSN=DBTest") ' connection to ODBC database called DBTest
DbSelect("SELECT * FROM DATA",DYNASET) ' select all records in table DATA
DbMove(2) 'move read pointer to the 2nd record