Accessing ReplicationClientError Objects

You access an existing ReplicationClientError object by calling the ReplicationClient.GetExtendedErrorInfo method, as in the following example, where ReplError is the name of the ReplicationClientError object:

Option Explicit 
On Error Resume Next

dim ReplClient
set ReplClient = CreateObject("CrsApi.ReplicationClient")
ReplClient.Initialize("Project1")
if err.Number > 0 then
  dim ReplError 
  set ReplError = ReplClient.GetExtendedErrorInfo

  'If the ReplError array isn't empty, loop through it
  'and display each error
  dim NumElements = Ubound(ReplError)

  if NumElements > 0 then
    Wscript.Echo "The following errors were received: "
    dim i
    for i = 0 to NumElements
    Wscript.Echo ReplError(i).ErrorCode
    Next
  end if
end if

'Release objects
set ReplError  = Nothing
set ReplClient = Nothing

© 1997-1998 Microsoft Corporation. All rights reserved.