The following procedure implements synchronization.
Add a synchronization function to your application
Add the Synchronize function to tutorial.js.
function Synchronize() { var sync_parms; sync_parms = Connection.syncParms; sync_parms.setUserName( "tutorial" ); sync_parms.setPassword( "tutorial" ); sync_parms.setVersion( "tutorial" ); sync_parms.setStream( sync_parms.STREAM_TYPE_TCPIP ); try { Connection.synchronize(); } catch( ex ) { alert( "Error: cannot synchronize: " + ex.getMessage() ); } } |
The synchronization parameters are stored in the SyncParms object. For example, the SyncParms.userName property specifies the user name for which MobiLink searches. The SyncParms.sendColumnNames property specifies that the column names are sent to MobiLink so that it can generate upload and download scripts.
This function uses a TCP/IP synchronization stream and the default network communication options (stream parameters). These default options assume that you are synchronizing from either a Windows Mobile client connected to the computer running the MobiLink server via ActiveSync, or from a 32-bit Windows desktop client running on the same computer as MobiLink. If this is not the case, change the synchronization stream type and set the network communication options to the appropriate values.
See also:
Add the following function to main.htm:
function ClickSync() { Synchronize(); DisplayRow(); } |
Start the MobiLink server using the tutorial_mlsrv.bat file.
The data in the Customer table should now be downloaded. You should be able to move through the rows in the Customer table of the remote database.
This completes the tutorial. See Listings for main.htm and tutorial.js for complete code samples for main.htm and tutorial.js.
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |