Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 » MobiLink - Client Administration » SQL Anywhere Clients for MobiLink » Dbmlsync integration component (deprecated) » Dbmlsync integration component events


EndSynchronization event

The EndSynchronization event is triggered when a synchronization is complete.

Public Event EndSynchronization(
  ByVal exitCode As Integer,
  ByRef restart As Boolean
Member of DbmlsyncCOM.Dbmlsync

exitCode   If set to anything other than zero, this indicates that a synchronization error occurred.

restart   This value is set to false when the event is called. If the event changes its value to true, dbmlsync restarts the synchronization.


Use this event to add custom actions when a synchronization is complete.


The following Visual Basic .NET example uses the EndSynchronization event to restart up to five failed synchronization attempts. If all restart attempts failed, the message "All restart attempts failed" is output, along with the exit code. If a synchronization is successful, the message "Synchronization succeeded " is output, along with the exit code.

' Global variable for the number of restarts
Dim numberOfRestarts As Integer

Private Sub dbmlsync1_EndSynchronization(
 ByVal ExitCode As Integer,
 ByRef restart As Boolean
Handles dbmlsync1.EndSynchronization

    If numberOfRestarts < 5 Then
        MsgBox("Restart Number: " + CStr(numberOfRestarts + 1))
        If ExitCode <> 0 Then
            ' restart the failed synchronization
            restart = True
            numberOfRestarts = numberOfRestarts + 1
            ' the last synchronization succeeded
            MsgBox("Synchronization succeeded. " + _
              "Exit code: " + CStr(ExitCode))
        End If
        MsgBox("All restart attempts failed. " + _
             "Exit code: " + CStr(ExitCode))
    End If

End Sub