Previous in Contents Next in Contents

Disconnect Method

This method closes the connections to the destination servers defined for the project.

Syntax

ReplicationClient.Disconnect

Remarks

You must have Site Server Publishing administrator privileges on the server to call this method.

Disconnect does an implicit Commit operation, so you need not call Commit after a Disconnect.

If you use the SendFile, SendFiles, and DeleteFile methods without the Connect and Disconnect methods, SendFile, SendFiles, and DeleteFile each perform their own connecting and disconnecting to the destination server. Connect and Disconnect let you avoid this overhead, which can be significant when updating more than a few files.

Example

The following example deletes the file Oldfile.htm and sends the file Newfile.htm on the Project1 destination servers.

Option Explicit 
On Error Resume Next

dim Client
set Client = CreateObject("CrsApi.ReplicationClient")
Client.Initialize("Project1")
Client.Connect
Client.DeleteFile("oldfile.htm")
Client.SendFile("newfile.htm")
Client.Disconnect

'Release Client object
set Client = Nothing

See Also

ReplicationClient.Connect


© 1997-2000 Microsoft Corporation. All rights reserved.