Previous in Contents Next in Contents

Accessing ReplicationClientError Objects

You access an existing ReplicationClientError object by calling the ReplicationClient.GetExtendedErrorInfo method, which returns an array of ReplicationClientError objects. Since the array is empty when no error information is available, be sure to do bounds checking before accessing the array.

ReplError is the name of the ReplicationClientError object in the following example:

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-2000 Microsoft Corporation. All rights reserved.