UltraLite for MobileVB User's Guide
Understanding UltraLite for MobileVB Development
Accessing data using dynamic SQL
Use the SELECT statement to retrieve information from the database.
To execute a SELECT query using ExecuteQuery:
Declare variables required for the operation:
Dim PrepStmt As ULPreparedStatement Dim MyResultSet As ULResultSet
Assign a prepared statement to your ULPreparedStatement object.
Set PrepStmt = Connection.PrepareStatement( _ "SELECT Name FROM customer")
Execute the statement. In the following code, a MobileVB listbox captures the result of the SELECT query.
Set MyResultSet = PrepStmt.ExecuteQuery While MyResultSet.MoveNext aflistbox1.AddItem MyResultSet.GetString(1) Wend
For more information on moving through result sets, see Navigating through Dynamic SQL result sets
Get column values from your database