Contents Index Lesson 1: Configure eMbedded Visual C++ Explanation of the sample program

UltraLite Embedded SQL User's Guide
  Tutorial: Build an Application Using Embedded SQL

Lesson 2: Write an embedded SQL source file


The following procedure creates a sample program that establishes a connection with the UltraLite CustDB sample database and executes a query.

To build the sample embedded SQL UltraLite application

  1. Start Microsoft eMbedded Visual C++.

    Choose Start > Programs > Microsoft eMbedded Visual Tools > eMbedded Visual C++.

  2. Create a new workspace named UltraLite:

  3. Create a new project named esql and add it to the UltraLite workspace.

  4. Create the sample.sqc source file.

  5. Configure the sample.sqc source file settings to invoke the SQL preprocessor to preprocess the source file:

  6. Start the Adaptive Server Anywhere personal database server.

    By starting the database server, both the SQL preprocessor and the UltraLite analyzer will have access to your reference database. The sample application uses the CustDB sample database custdb.db as a reference database and as consolidated database.

    Start the database server at the command line from the Samples\UltraLite\CusDB directory containing custdb.db as follows:

    dbeng9 custdb.db

    Alternatively, you can start the database server by selecting Start > Programs > SQL Anywhere 9 > UltraLite > Personal Server Sample for UltraLite.

  7. Preprocess the sample.sqc file.

    Because the sample application consists of only one source file, the preprocessor automatically runs the UltraLite analyzer as well and appends extra C/C++ code to the generated source file.

  8. Add sample.cpp to the project:


Explanation of the sample program

Contents Index Lesson 1: Configure eMbedded Visual C++ Explanation of the sample program