UltraLite Embedded SQL User's Guide
Tutorial: Build an Application Using Embedded SQL
Lesson 4: Add synchronization to your application
After you have made changes to sample.sqc, you must preprocess sample.sqc and rebuild esql.exe.
To synchronize your application
Ensure that the Adaptive Server Anywhere database server is still running.
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 );
Preprocess sample.sqc.
Choose Build
Build the executable.
Select Build
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
Run the application:
Select Build
The remote database will be synchronized with the consolidated database, filling the tables in the remote database with data. The select query in the sample application will be processed, and a row of query results will appear on the screen.