Previous in Contents Next in Contents

DeleteEventSink Method

This method removes an event sink.

Syntax

ReplicationServer.DeleteEventSink(Sink)

Parameters

Sink

The name of the event sink to delete.

Remarks

The method fails (Err.Number is set to E_FAIL) if Sink is Empty ("") or if the event sink specified by Sink does not exist.

Example

The following example deletes the MySink event sink.

Option Explicit 
On Error Resume Next 

const CRS_ERROR_NO_EVENTSINKS    = 15145
const CRS_ERROR_EVENTSINK_NOT_FOUND  = 15146

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

Err.Clear

ReplServer.Delete("MySink")

if Err.Number = CRS_ERROR_NO_EVENTSINKS then
  Wscript.Echo "No event sinks defined!"
elseif Err.Number = CRS_ERROR_EVENTSINK_NOT_FOUND then
  Wscript.Echo "Event sink MySink not found!"
end if

'Release Server object
set ReplServer = Nothing

See Also

AddEventSink, EnumEventSinks


© 1997-2000 Microsoft Corporation. All rights reserved.