LastError Property (Read Only)

Measurement Studio User Interface

LastError Property (Read Only)

Syntax

CWBinding.LastError

Data Type

Long

Purpose

Returns the last error code used in an CWBindingStatusUpdated event.

Remarks

The value of LastError is 0 if there was no error the last time the CWBindingStatusUpdated event was generated.

Some common errors include errors caused by incorrect network configurations, insufficient access privileges to connect to the data source, or an incorrectly formed URL.

The value of the error code is an HRESULT, the ActiveX data type used for reporting errors. It might include errors detected by the CWBinding or by the operating systems networking services. If an error is encountered, the message that goes with the last error is stored in the LastMessage property.

To determine the task the CWBinding object was performing when the error occurred, check the LastMessage and Status properties.

Example

'Display the current status in the form
'[status:error] Message

'Create a reference to a CWBinding object
'on CWGraph1
Dim Binding As CWBinding
Set Binding = CWGraph1.CWBindings.Item(1)

Dim str As String
If (Binding.StatusUpdated) Then 
   str = "[" & CWBinding.Status & ":" & _
           CWBinding.LastError & "]"  & _
           CWBinding.LastMessage
   MsgBox str 
End If

See Also

CWBindingStatusUpdated

LastMessage

Status

StatusUpdated