The following procedure implements synchronization. Synchronization requires SQL Anywhere. This portion of the tutorial is optional.
Write code to implement the Synchronize button.
In the code below, the ULSyncParms object contains synchronization parameters. For example, the UserName property specifies that when MobiLink is started, it uses the specified user name to determine the proper set of MobiLink scripts to employ for the synchronization process. The DownloadOnly property is set to true (in this program) to ensure that no data is uploaded from the UltraLite database since this is a simple demonstration application.
For more information about synchronization parameters, see UltraLite Synchronization Parameters and Network Protocol options.
Add the following procedure to the form:
Private Sub btnSync_Click() With Connection.SyncParms .UserName = "50" .Stream = ULStreamType.ulTCPIP .Version = "custdb 10.0" .DownloadOnly = True End With Connection.Synchronize CustomerTable.MoveFirst DisplayCurrentRow End Sub