UltraLite ActiveX User's Guide
Understanding UltraLite ActiveX Development
Accessing and manipulating data using Dynamic SQL
Navigation with Dynamic SQL
UltraLite ActiveX provides you with a number of methods to navigate a result set in order to perform a wide range of navigation tasks.
The following methods 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 fragment demonstrates how to use the MoveFirst method to navigate within a result set.
' eMbedded Visual Basic Set x = Connection.PrepareStatement( "SELECT ID, Name FROM customer") Set MyResultSet = x.ExecuteQuery MyResultSet.MoveFirst
// JScript x = Connection.PrepareStatement( "SELECT ID, Name FROM customer"); MyResultSet = x.ExecuteQuery(); MyResultSet.MoveFirst();
The same technique is used for all of the Move methods. For more information about these navigational methods, see ULResultSet class.