Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - AppForge Programming » Understanding UltraLite Development with AppForge » Working with data using the table API

Working with data using the table API Next Page

Navigation with the Table API


UltraLite for MobileVB provides you with a number of methods to navigate a table to perform a wide range of navigation tasks.

The following methods of the ULTable object allow you to navigate your result set:

Example

The following code opens the customer table and scrolls through its rows. It then displays a message box with the last name of each customer.

'MobileVB using VB6
Dim TCustomer as ULTable
Set TCustomer = Conn.GetTable("customer")
TCustomer.Open
While TCustomer.MoveNext
   MsgBox TCustomer.Column( "lname" ).StringValue
Wend
'Crossfire using vb.net
Dim TCustomer as UltraLiteAFLib.ULTable
Set TCustomer = Conn.GetTable("Customer")
TCustomer.Open
While TCustomer.MoveNext
   MsgBox TCustomer.Column("LName").StringValue
Wend
Specifying an index

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.

Example

The following code moves to the first row of the customer table as ordered by the ix_name index.

'MobileVB using VB6
Set TCustomer = Conn.GetTable("customer")
TCustomer.Open "ix_name"
TCustomer.MoveFirst
'Crossfire using vb.net
TCustomer = Conn.GetTable("customer")
TCustomer.Open "ix_name"
TCustomer.MoveFirst