How to: View and Modify Push Subscription Properties (RMO Programming)
You can modify push subscriptions and access their properties programmatically by using Replication Management Objects (RMO). The RMO classes you use to view or modify push subscription properties depend on the type of publication to which the push subscription is subscribed.
To view or modify properties of a push subscription to a snapshot or transactional publication
Create a connection to the Publisher by using the ServerConnection class.
Create an instance of the TransSubscription class.
Set the PublicationName, DatabaseName, SubscriberName, and SubscriptionDBName properties.
Set the ServerConnection from step 1 for the ConnectionContext property setting.
Call the LoadProperties method to get the properties of the object. If this method returns false, either the subscription properties in step 3 were defined incorrectly or the subscription does not exist.
(Optional) To change properties, set a new value for one of the TransSubscription properties that can be set, and then call the CommitPropertyChanges method.
(Optional) To view the new settings, call the Refresh method to reload the properties for the subscription.
To view or modify properties of a push subscription to a merge publication
Create a connection to the Subscriber by using the ServerConnection class.
Create an instance of the MergeSubscription class.
Set the PublicationName, DatabaseName, SubscriberName, and SubscriptionDBName properties.
Set the ServerConnection from step 1 for the ConnectionContext property setting.
Call the LoadProperties method to get the properties of the object. If this method returns false, either the subscription properties in step 3 were defined incorrectly or the subscription does not exist.
(Optional) To change properties, set a new value for one of the MergeSubscription properties that can be set, and then call the CommitPropertyChanges method.
(Optional) To view the new settings, call the Refresh method to reload the properties for the subscription.
Voir aussi
Tâches
Procédure : créer un abonnement par envoi de données (programmation RMO)
How to: Delete a Push Subscription (RMO Programming)
How to: View and Modify Push Subscription Properties (Replication Transact-SQL Programming)