Contents Index Write code for navigation and data manipulation Lesson 4: Deploy to a device

UltraLite for MobileVB User's Guide
  Tutorial: An UltraLite Application for PocketPC
    Lesson 3: Write the sample code

Write code to synchronize


The following procedure implements synchronization. This procedure requires SQL Anywhere.

To write code for the synchronize button

  1. Implement the code for the Synchronize button.

    Add the following procedure to the form:

    Private Sub btnSync_Click()
        With Connection.SyncParms
            .UserName = "afsample"
            .Stream = ULStreamType.ulTCPIP
            .Version = "ul_default"
            .SendColumnNames = True
        End With
        Connection.Synchronize
        DisplayCurrentRow
    End Sub

    The SyncParms object contains the synchronization parameters. For this simple example, we start MobiLink so that it will add new users. Also, we send the column names to MobiLink so it can generate proper upload and download scripts.

  2. From a command prompt, start the MobiLink synchronization server with the following command line:

    dbmlsrv9 -c "dsn=ASA 9.0 Sample" -v+ -zu+ -za

    The ASA 9.0 Sample database has a Customer table with columns matching those in the UltraLite database you have created. You can synchronize your UltraLite application with the ASA  9.0 Sample database.

    The -zu+ and -za command line options provide automatic addition of users and generation of synchronization scripts. For more information on these options, see the MobiLink Synchronization User's Guide.

  3. Start the UltraLite application.

  4. Delete all the rows in your table.

    Any rows in the table would be uploaded to the ASA 9.0 Sample database.

  5. Synchronize your application.


Contents Index Write code for navigation and data manipulation Lesson 4: Deploy to a device