AddSubscription Method (Replication)

The AddSubscription method adds a new subscription based on the specified control properties.

Applies To
SQLDistribution Object SQLMerge Object

Syntax

object.AddSubscription(DBADDOPTION, SubscriptionHost)

Part Description
object Expression that evaluates to an object in the Applies To list
DBADDOPTION Option to add
SubscriptionHost Subscription host

Remarks

Push subscriptions are not currently supported by this method.

If DBADDOPTION is set to ATTACK_DATABASE and SubscriberDatasourceType is set to SQL_SERVER, AddSubscription can only work with single-file databases.

Returns
Return code Description
S_OK Method succeeded.
E_FAIL General failure occurred. Check error records for detailed information.
REPLX_E_DBEXISTS Specified database already exists.
REPLX_E_DBNOTFOUND Specified database does not exist.
REPLX_E_SUBEXISTS Specified subscription already exists.
REPLX_E_RETRYFAILURE Failure occurred that may require retrying the last operation.

Prototype C/C++

HRESULT AddSubscription(
DBADDOPTION DBAddOption,
SUBSCRIPTION_HOST SubscriptionHost);

See Also

DropSubscription Method

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.