Previous in Contents Next in Contents

Initialize Method

This method initializes the ReplicationServer object.

Syntax

ReplicationServer.Initialize[(Server)]

Parameters

Server

The server to communicate with. This value can be Empty ("") for the current server.

Remarks

This method must be called before any other methods.

Note   If you attempt to initialize a remote server where the Content Deployment service is not running, this methods fails and Content Deployment sets the Err.Number property to &HC0003B4E,  (CRS_ERROR_SERVICE_DOWN_ON_REMOTE_SERVER)

If you encounter this error, you can restart and reinitialize the server, as in the following code snippet:

Option Explicit 
On Error Resume Next

Const E_NOERROR = 0
Const CRS_ERROR_SERVICE_DOWN_ON_REMOTE_SERVER = &HC0003B4E

dim ReplServer, RemoteServer
RemoteServer = "MyRemoteServer"

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

If Err.Number = CRS_ERROR_SERVICE_DOWN_ON_REMOTE_SERVER Then
  ReplServer.Start
  ReplServer.Initialize(RemoteServer)

  If Err.Number <> E_NOERROR Then
    Wscript.Echo "Service failed to start/initialize on " _
      & RemoteServer
    Wscript.Echo "Error:       0x" & Hex(Err.Number)
    Wscript.Echo "Description: " & Err.Description
    Wscript.Quit
  End If
End If

...

'Release Server object
set ReplServer = Nothing

Example

The following example initializes the current server.

Option Explicit 
On Error Resume Next

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

'Release Server object
set ReplServer = Nothing

See Also

InitializeEx


© 1997-2000 Microsoft Corporation. All rights reserved.