Setting up an UltraLite remote database

The following procedure creates a remote database for CustDB. The CustDB remote database must be an UltraLite database.

The application logic for the remote database is located in samples-dir\UltraLite\CustDB. It includes the following files:

  • Embedded SQL logic   The file custdb.sqc contains the SQL statements needed to query and modify information from the UltraLite database, and the calls required to start synchronization with the consolidated database.

  • C++ API logic   The file custdbcomp.cpp contains the C++ API logic.

  • User-interface features   These features are stored separately, in platform-specific subdirectories of Samples\UltraLite\CustDB.

You complete the following steps to install the sample application to a remote device that is running UltraLite:

To install the sample application to a remote device
  1. Start the consolidated database.

  2. Start the MobiLink server.

  3. Install the sample application to your remote device.

  4. Start the sample application on the remote device.

  5. Synchronize the sample application.

Example

The following example installs the CustDB sample on a Palm device running against a DB2 consolidated database.

  1. Ensure that the consolidated database is running:

    For a DB2 LUW database, open a DB2 Command Window. Type the following command, where userid and password are the user ID and password for connecting to the DB2 LUW database:

    db2 connect to CustDB user userid using password
  2. Start the MobiLink server:

    For a DB2 LUW database, at a command prompt, run the following command:

    mlsrv11 -c "DSN=CustDB" -zp
  3. Install the sample application to your Palm device:

    1. On your PC, start Palm Desktop.

    2. Click Quick Install on the Palm Desktop toolbar.

    3. Click Add. Browse to custdb.prc in the UltraLite\palm\68k subdirectory of your SQL Anywhere 11 installation.

    4. Click Open.

    5. HotSync your Palm device.

  4. Start the CustDB sample application on your Palm device:

    1. Place your Palm device in its cradle.

      When you start the sample application for the first time, you are prompted to synchronize to download an initial copy of the data. This step is required only the first time you start the application. After that, the downloaded data is stored in the UltraLite database.

    2. Launch the sample application.

      From the Applications view, tap CustDB.

    3. At the prompt, type an employee ID.

      For the purpose of this tutorial, enter a value of 50. The sample application also allows values of 51, 52, or 53, but behaves slightly differently in these cases.

      For more information about the behavior of each user ID, see Users in the CustDB sample.

      A window tells you that you must synchronize before proceeding.

    4. Synchronize your application.

      Use HotSync to obtain an initial copy of the data.

    5. Confirm that the data has been synchronized into the application.

      From the Applications view, tap the CustDB application. The display shows an entry sheet for a customer, with entries.

  5. Synchronize the remote application with the consolidated database. You only need to complete this step when you have made changes to the database.

    1. Ensure that the consolidated database and the MobiLink server are running.

    2. Place the Palm device in its cradle.

    3. Press the HotSync button to synchronize.