Previous in Contents Next in Contents

RemoveDestination Method

This method removes a destination from the route.

Syntax

ReplicationRoute.RemoveDestination(Destination)

Parameters

Destination

Name of the server or route to remove.

Example

The following example removes the destination server TestPC from the route Test.

Option Explicit 
On Error Resume Next 

const CRS_ERROR_NO_MORE_ITEMS  = 0&80003B17

dim ReplServer
set ReplServer = CreateObject("CrsApi.ReplicationServer")
ReplServer.Initialize("")

dim Iterator
Iterator = 0
dim ReplRoute

do while True
  'Clear any error text
  Err.Clear
  'Get a route
  set ReplRoute = ReplServer.EnumRoutes(Iterator)

  'Quit if empty object returned (no more instances)
  if IsEmpty(ReplRoute) then exit do

  'Quit if "No more items" error 
  dim ReplError
  ReplError = Err.Number
  if ReplError = CRS_ERROR_NO_MORE_ITEMS then exit do

  'If the route is Test, delete TestPC
  if ReplRoute.Name = Test then ReplRoute.DeleteDestination("TestPC")

loop
'Release objects
set ReplRoute  = Nothing
set ReplServer = Nothing

See Also

AddDestination, EnumDestination


© 1997-2000 Microsoft Corporation. All rights reserved.