UltraLite ActiveX User's Guide
Understanding UltraLite ActiveX Development
Synchronizing UltraLite applications
This section applies only to eMbedded Visual Basic. You cannot monitor synchronization progress using JScript.
To monitor synchronization progress, you add a synchronization dialog to your project and code accordingly.
The following procedure causes the dialog in ULSyncStatus.ebf to show status messages.
To add a synchronization status dialog to your project
Browse to the Samples\UltraLiteActiveX\dbview.evb subdirectory of your SQL Anywhere installation.
Copy and add ULSyncStatus.bas and ULSyncStatus.ebf to your project.
Add code to your UltraLite ActiveX project.
Instead of using CreateObject to instantiate your ULDatabase Manager, use the following instruction:
Set DBMgr = CreateObjectWithEvents("UltraLite.ULDatabaseManager", "UL_")
Ensure that your synchronization call accepts callbacks as follows.
connection.Synchronize(True)
Write code that captures event notifications in the Synchronization Progress Dialog.
The following method shows users insert, update, and delete data when data is sent to the consolidated database.
Private Sub UL_OnSend(ByVal nBytes As Long, ByVal _ nInserts As Long, ByVal nUpdates As Long, ByVal nDeletes As Long)_ prLine "OnSend " & nBytes & " bytes, " & nInserts &_ " inserts, " & nUpdates & " updates, " & nDeletes & " deletes"_ End Sub
The following method shows users insert, update, and delete data when data is received at the consolidated database.
Private Sub UL_OnReceive(ByVal nBytes As Long, ByVal _ nInserts As Long, ByVal nUpdates As Long, ByVal nDeletes As Long)_ prLine "OnReceive " & nBytes & " bytes, " & nInserts & " inserts, " & nUpdates & " updates, " & nDeletes & " deletes" End Sub
The following method shows users when synchronization states are changed.
Private Sub UL_OnStateChange(ByVal newState As Long, _ ByVal oldState As Long) prLine "OnStateChange new:" & newState & ", old: " & oldState End Sub
The following method shows users when the currently synchronized table changes.
Private Sub UL_OnTableChange(ByVal newTableIndex As _ Long, ByVal numTables As Long) prLine "OnTableChange index:" & newTableIndex & ", #tables=" & numTables End Sub