Rollback Method

This method rolls back to a previous replication.

Syntax

ReplicationProject.Rollback(NumRollbacks)

Parameters

NumRollbacks

The number of rollbacks to perform.

Remarks

Example

The following example cancels the project and rolls the replication back to the previous state if the status is aborted.

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 ReplStatus
ReplStatus = ReplInst.Status

'Quit and roll back one if the status was aborted 
if ReplStatus = REPL_STATE_ABORTED then
  ReplClient.Cancel
  ReplProject.RollBack(1)
end if

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

© 1997-1998 Microsoft Corporation. All rights reserved.