Contents Index Data manipulation: INSERT, UPDATE and DELETE Get column values from your database

UltraLite for MobileVB User's Guide
  Understanding UltraLite for MobileVB Development
    Accessing data using dynamic SQL

Data retrieval: SELECT


Use the SELECT statement to retrieve information from the database.

To execute a SELECT query using ExecuteQuery:

  1. Declare variables required for the operation:

    Dim PrepStmt As ULPreparedStatement
    Dim MyResultSet As ULResultSet
  2. Assign a prepared statement to your ULPreparedStatement object.

    Set PrepStmt = Connection.PrepareStatement( _
      "SELECT Name FROM customer")
  3. 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

Contents Index Data manipulation: INSERT, UPDATE and DELETE Get column values from your database