ErrorEntry.Item method

AutoCAD Map 3D ActiveX

ErrorEntry.Item method

Gets a diagnostic parameter associated with the error.

Item(Index As Long) As DiagParam

Returns the diagnostic parameter.

Index

Index, starting at 0, of a diagnostic parameter in the ErrorEntry collection.

The following example shows getting an error and then displaying the diagnostic parameters, message and SQL statement in the Immediate Window.

Dim diapm As DiagParam

 

On Error GoTo ErrHandler

' Some error occurs while accessing the SQL database

' ...

Exit Sub

ErrHandler:

Set diapm = amap.ErrorStack.Item(0).Add(122, "incorrect syntax", _

"SELECT * FROM RECORD3", 5) 

Debug.Print amap.ErrorStack.Item(0).Item(0).Message 

Debug.Print amap.ErrorStack.Item(0).Item(0).SQLStatement