Previous in Contents Next in Contents

EnumSchedules Method

This method lists the schedules for the project.

Syntax

ReplicationProject.EnumSchedules(Iterator)

Parameters

Iterator

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

Example

The following example displays the descriptions for the schedules 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 Sched
dim Iterator
Iterator = 0
dim ReplError

Wscript.Echo "The schedule descriptions for Project1 are"

do while True
  'Clear any error text
  Err.Clear

  set Sched = Project.EnumSchedules(Iterator)

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

  Wscript.Echo Sched.Description
Loop
'Release objects
set Sched       = Nothing
set ReplProject = Nothing
set ReplServer  = Nothing

See Also

AddSchedule


© 1997-2000 Microsoft Corporation. All rights reserved.