G
Guest
Using the following Code the Progress Bar does NOT update. Everything else
works great in an Access 2002 Project using Anonymous Merge Pull Subscription
over the Internet. It is based on the ReplSamp.vbp in
C:\Program Files\Microsoft SQL
Server\80\Tools\DevTools\Samples\sqlrepl\replctrl\vb\replsamp.vbp
Probably I am NOT using the DoEvents function correctly.
Option Compare Database
Option Explicit
Private WithEvents SQLMerge As SQLMerge
Private Sub MergePublication_Click()
On Error Resume Next
ProgressBar.Value = 0
ProgressLabel.Caption = "Starting Merge Replication"
MergePublication.Enabled = False
Dim oErrorObject As SQLReplError
Dim mobjMerge As SQLMERGXLib.SQLMerge
Set mobjMerge = New SQLMERGXLib.SQLMerge
' Removed parameters for mobjMerge.Publisher mobjMerge.Subscriber
mobjMerge.Initialize
mobjMerge.Run
mobjMerge.Terminate
ProgressBar.Value = 0
ProgressLabel.Caption = ""
MergePublication.Enabled = True
End Sub
Private Function SQLMerge_Status(ByVal Message As String, ByVal Percent As
Long) As STATUS_RETURN_CODE
ProgressBar.Value = Percent
ProgressLabel.Caption = Message
Me.Refresh
DoEvents
SQLMerge_Status = SUCCESS
End Function
-- TIA
Aubrey Kelley
works great in an Access 2002 Project using Anonymous Merge Pull Subscription
over the Internet. It is based on the ReplSamp.vbp in
C:\Program Files\Microsoft SQL
Server\80\Tools\DevTools\Samples\sqlrepl\replctrl\vb\replsamp.vbp
Probably I am NOT using the DoEvents function correctly.
Option Compare Database
Option Explicit
Private WithEvents SQLMerge As SQLMerge
Private Sub MergePublication_Click()
On Error Resume Next
ProgressBar.Value = 0
ProgressLabel.Caption = "Starting Merge Replication"
MergePublication.Enabled = False
Dim oErrorObject As SQLReplError
Dim mobjMerge As SQLMERGXLib.SQLMerge
Set mobjMerge = New SQLMERGXLib.SQLMerge
' Removed parameters for mobjMerge.Publisher mobjMerge.Subscriber
mobjMerge.Initialize
mobjMerge.Run
mobjMerge.Terminate
ProgressBar.Value = 0
ProgressLabel.Caption = ""
MergePublication.Enabled = True
End Sub
Private Function SQLMerge_Status(ByVal Message As String, ByVal Percent As
Long) As STATUS_RETURN_CODE
ProgressBar.Value = Percent
ProgressLabel.Caption = Message
Me.Refresh
DoEvents
SQLMerge_Status = SUCCESS
End Function
-- TIA
Aubrey Kelley