EnumDestination Method

This method lists the destinations for the project.

Syntax

ReplicationProject.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 displays the destinations for the Project1 project.

Option Explicit 
On Error Resume Next

const OPEN_EXISTING_PROJECT  = 2
const CRS_ERROR_NO_MORE_ITEMS  = 0&80003B17

dim ReplServer
set ReplServer = CreateObject("Crsapi.ReplicationServer")
ReplServer.Initialize("")
dim Project
set Project = ReplServer.OpenProject("Project1", OPEN_EXISTING_PROJECT)

dim Dest
dim Iterator
Iterator = 0
dim ReplError

Wscript.Echo "The destination servers for Project1 are:"

do while True
  'Clear any error text
  Err.Clear

  Dest = Project.EnumDestinations(Iterator)
  'Quit if "No more items" error 
  ReplError = Err.Number
  if ReplError = CRS_ERROR_NO_MORE_ITEMS then exit do

  Wscript.Echo Dest
Loop

'Release objects
set ReplProject = Nothing
set ReplServer  = Nothing

See Also

Enum


© 1997-1998 Microsoft Corporation. All rights reserved.