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

Navigation with the Table API Next Page

Accessing the values of the current row

At any time, a ULTable object is positioned at one of the following places.

If the ULTable object is positioned on a row, you can use the Column method together with an appropriate property to get the value of that column for the current row.


The following code retrieves the value of three columns from the tCustomer ULTable object, and displays them in text boxes.

Dim colID, colFirstName, colLastName As ULColumn
Set colID = tCustomer.Column("ID")
Set colFirstName = tCustomer.Column("fname")
Set colLastName = tCustomer.Column("lname")
txtID.Text = colID.IntegerValue
txtFirstName.Text = colFirstName.StringValue
txtLastName.Text = colLastName.StringValue

You can also use the properties of ULColumn to set values.

colLastName.StringValue = "Kaminski"

By assigning values to these properties you do not alter the value of the data in the database.

You can assign values to the properties even if you are before the first row or after the last row of the table. You cannot, however, get values from the column. For example, the following code generates an error.

' This code is incorrect
id = TCustomer.Column( "ID" ).IntegerValue

To work with binary data, use the GetByteChunk method instead of a property.

See GetByteChunk method.

Casting values

The ULColumn property you choose must match the Visual Basic data type you want to assign. UltraLite automatically casts incompatible data types, so that you could use the StringValue method to fetch an integer value into a string variable, and so on. See Converting data types explicitly.

For more information about accessing values of the current row, see ULColumn class.