Contents Index Synchronization via TCP/IP Building Embedded SQL Applications

UltraLite Embedded SQL User's Guide
  Tutorial: Build an Application Using Embedded SQL
    Lesson 4: Add synchronization to your application

Running the sample application with synchronization


After you have made changes to sample.sqc, you must preprocess sample.sqc and rebuild esql.exe.

To synchronize your application

  1. Ensure that the Adaptive Server Anywhere database server is still running.

  2. Delete the INSERT commands and add the following code. Replace your-pc with the name of your computer.

    auto ul_synch_info synch_info;
    ULInitSynchInfo( &synch_info );
    synch_info.user_name = UL_TEXT("50");
    synch_info.version = UL_TEXT("custdb 9.0");
    synch_info.stream = ULSocketStream();
    synch_info.send_column_names = ul_true;
    synch_info.stream_parms = UL_TEXT("host=your-pc;port=2439");
    ULSynchronize( &sqlca, &synch_info );
  3. Preprocess sample.sqc.

    Choose Build > Compile sample.sqc to recompile the altered file. When prompted, choose to reload sample.cpp.

  4. Build the executable.

    Select Build > Build esql.exe to build the sample executable.

  5. Start the MobiLink synchronization server.

    At a command prompt, execute the following command on a single line:

    dbmlsrv9 -c "DSN=UltraLite 9.0 Sample" -o ulsync.mls -vcr -x tcpip -za
  6. Run the application:


Contents Index Synchronization via TCP/IP Building Embedded SQL Applications