Contents Index Data manipulation internals Accessing the values of the current row

UltraLite for MobileVB User's Guide
  Understanding UltraLite for MobileVB Development
    Accessing data using the table-based API

Scrolling through the rows of a table


The following code opens the customer table and scrolls through its rows, displaying a message box with the value of the lname column for each row.

Dim TCustomer as ULTable
Set TCustomer = Conn.GetTable("customer")
TCustomer.Open
While TCustomer.MoveNext
    MsgBox TCustomer.GetColumn( "lname" ).StringValue
Wend

You expose the rows of the table to the application when you open the table object. By default, the rows are exposed in order by primary key value, but you can specify an index to access the rows in a particular order. The following code moves to the first row of the customer table as ordered by the ix_name index.

Set TCustomer = Conn.GetTable("customer")
TCustomer.Open "ix_name"
TCustomer.MoveFirst

Contents Index Data manipulation internals Accessing the values of the current row