Previous in Contents Next in Contents

EnumDestination Method

This method lists the destinations for the route.

Syntax

ReplicationRoute.EnumDestination(Iterator)

Parameters

Iterator

Used by the service to enumerate the list of destinations. This value should be initialized to zero, and should not be modified.

Example

The following example lists the destinations for the Temp route.

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
dim RouteParam

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

  'We have a valid route. Check if it's the one we want
  dim Name = ReplRoute.Name
  if Name = "Temp" then
    dim RouteDest
    Wscript.Echo "The Temp route had the following destinations"
    
    do while True
    Err.Clear
    RouteDest = ReplRoute.EnumDestination(Iterator)

    'Exit if we've looped past the last parameter
    if RouteDest = CRS_ERROR_NO_MORE_ITEMS then exit do

    Wscript.Echo RouteDest
    Loop
  end if
  'We can exit now, since we already found our route
  exit do

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

See Also

Enum


© 1997-2000 Microsoft Corporation. All rights reserved.