UltraLite for MobileVB provides you with a number of methods to navigate a result set to perform a wide range of navigation tasks.
The following methods of the ULResultSet object allow you to navigate your result set:
MoveAfterLast moves to a position after the last row.
MoveBeforeFirst moves to a position before the first row.
MoveFirst moves to the first row.
MoveLast moves to the last row.
MoveNext moves to the next row.
MovePrevious moves to the previous row.
MoveRelative moves a certain number of rows relative to the current row. Positive index values move forward in the result set, negative index values move backward in the result set, and zero does not move the cursor. Zero is useful if you want to repopulate a row buffer.
The following code demonstrates how to use the MoveFirst method to navigate within a result set.
'MobileVB using VB6 Set PrepStmt = Connection.PrepareStatement( _ "SELECT ID, Name FROM customer") Set MyResultSet = PrepStmt.ExecuteQuery MyResultSet.MoveFirst 'Crossfire using vb.net PrepStmt = Connection.PrepareStatement( _ "SELECT ID, Name FROM customer") MyResultSet = PrepStmt.ExecuteQuery MyResultSet.MoveFirst
The same technique is used for all of the Move methods.
For more information about these navigational methods, see ULResultSet class.