Hi all,
I have an existing application that checks a few things before it
launches another application. One thing that the application needs to
check is the subscription properties of both the local database and the
remote (LAN) server.
I've stumbled upon some properties but I am trying to fit in the last
ones and I can't seem to find the right code to accomplish this... Can
anyone shine a little light on this please ?
The following code queries the SQL Server (remote) to get (some of) the
properties of the replicated database. What I would like to fit in
after the 'state' are the properties that you can retrieve with the
EnumAllSubscrip tions function. However, I can't seem to find the right
object (sample code) to retrieve those (or I'm just overlooking the
obvious)...
Here is (part of) the code I'm using to query the publication on the
remote server :
Dim oMergePublicati on As SQLDMO.MergePub lication2
Dim oSubscription As SQLDMO.MergeSub scription2
Me.lstPublicati ons.Clear
For Each oReplicationDat abase In
objSQLSERVER.Re plication.Repli cationDatabases
If oReplicationDat abase.Name = Me.txtSQLServer Database.Text
Then
For Each oMergePublicati on In
oReplicationDat abase.MergePubl ications
bFoundReplicate d = True
Me.lstPublicati ons.AddItem "Database replicated as
'" & oMergePublicati on.Name & "'"
For Each oSubscription In
oMergePublicati on.MergeSubscri ptions
Me.lstPublicati ons.AddItem " - subscriber
:" & oSubscription.S ubscriber
Me.lstPublicati ons.AddItem " - local
DB :" & oSubscription.S ubscriptionDB
Me.lstPublicati ons.AddItem " -
state :" & GetReplStatus(o Subscription.St atus)
Next
Next
'For Each osubscriber In oReplicationDat abase.
'Next
End If
Next
Set oReplicationDat abase = Nothing
Set oMergePublicati on = Nothing
After this, I also want to check the local DB (=pulled subscription)
and show some of the properties (from EnumAllSubscrip tions). For
example to warn the user about the need to synchronise (last_updated
value)...
Any help appreciated,
Many thanks
GB
--
Your eyes are weary from staring at the CRT. You feel sleepy. Notice
how restful it is to watch the cursor blink. Close your eyes. The
opinions stated above are yours. When I snap my fingers, you cannot
imagine why you ever felt otherwise. <snap>