UltraLite ActiveX User's Guide
Tutorial: An UltraLite Application for PocketPC
Lesson 3: Write the sample code
The following procedure implements synchronization. Synchronization requires SQL Anywhere Studio.
To write code for the synchronize button
Write code to implement the Synchronize button.
In the code below, the ULSyncParms object contains the synchronization parameters. For example, the ULSyncParms.UserName property specifies that when MobiLink is started, it will add a new user. The ULSyncParms.SendColumnNames property specifies that the column names will be sent to MobiLink so it can generate upload and download scripts.
Add the following procedure to the form:
Private Sub btnSync_Click()
Dim parms As ULSyncParms
Dim result As ULSyncResult
On Error Resume Next
Set parms = Connection.SyncParms
Set result = Connection.SyncResult
parms.UserName = "ULevbUser"
parms.Stream = ULStreamType.ulTCPIP
parms.Version = "ul_default"
parms.SendColumnNames = True
Connection.Synchronize (False)
If Err.Number <> UlSQLCode.ulSQLE_NOERROR Then
MsgBox result.StreamErrorCode
End If
End Sub