Cancel Method

This method cancels a running project.

Syntax

ReplicationProject.Cancel

Remarks

Example

The following example cancels the project if the replication is in the aborted state.

Option Explicit 
On Error Resume Next

const OPEN_EXISTING_PROJECT  = 2
const REPL_STATE_ABORTED   = 4

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

dim ReplProject
set ReplProject = ReplServer.OpenProject("Project1", OPEN_EXISTING_PROJECT)

dim ReplInst
set ReplInst = ReplProject.Start(0)

dim ReplState
ReplState = ReplInst.State

'Quit if the state is aborted 
if ReplState = REPL_STATE_ABORTED then ReplClient.Cancel

'Release objects
set ReplInst    = Nothing
set ReplProject = Nothing
set ReplServer  = Nothing

See Also

Start


© 1997-1998 Microsoft Corporation. All rights reserved.