Contents Index Accessing data using the table-based API Scrolling through the rows of a table

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

Data manipulation internals


UltraLite exposes the rows in a table to your application one at a time. The ULTable object has a current position, which may be on a row, before the first row, or after the last row of the table.

When your application changes its row (by a ULTable.MoveNext method or other method on the ULTable object) UltraLite copies the row to a buffer. There is one buffer per table. Any operations using ULColumn properties to get or set values affect only the copy of data in this buffer. They do not affect the data in the database. For example, the following statement changes the value of the ID column in the buffer to 3.

TCustomer.GetColumn( "ID" ).IntegerValue = 3
Using UltraLite modes 

UltraLite uses the values in the buffer for a variety of purposes, depending on the kind of operation you are carrying out. UltraLite has four different modes of operation, in addition to a default mode, and in each mode the buffer is used for a different purpose.

Whichever mode you are using, there is a similar sequence of operations:

  1. Enter the mode.

    The ULTable InsertBegin, UpdateBegin, FindBegin, and LookupBegin methods set UltraLite into the mode.

  2. Set the values in the buffer.

    Use the ULColumn object to set values in the buffer.

  3. Carry out the operation.

    Use a ULTable method such as Insert, Update, FindFirst, or LookupForward to carry out the operation, using the values in the buffer. In most cases the UltraLite mode is set back to the default method and you must enter a new mode before performing another data manipulation or searching operation. An exception is that Delete does not affect the Find mode.


Contents Index Accessing data using the table-based API Scrolling through the rows of a table