Gets a diagnostic parameter associated with the error.
Item(Index As Long) As DiagParam
Returns the diagnostic parameter.
Index
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