Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » UltraLite - C and C++ Programming » Tutorial: Build an Application Using Embedded SQL » Lesson 5: Add synchronization to your application

Synchronization via TCP/IP Next Page

Running the tutorial application with synchronization

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

To synchronize your application
  1. Delete the INSERT embedded SQL commands and add the following code:

    ULEnableTcpipSynchronization( &sqlca );
    auto ul_synch_info synch_info;
    ULInitSynchInfo( &synch_info );
    synch_info.user_name = UL_TEXT("50");
    synch_info.version = UL_TEXT("custdb 10.0");
    ULSynchronize( &sqlca, &synch_info );
  2. Preprocess sample.sqc.

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

  3. Build the executable.

    Choose Build > Build esql.exe to build the executable.

  4. Ensure that the SQL Anywhere database server is still running.

  5. Start the MobiLink server.

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

    mlsrv10 -c "DSN=SQL Anywhere 10 CustDB" -o -v+ -x tcpip
  6. Run the application: