ADO Error object - Source Property

Home | About me | EXCEL VB Programming (XL97-2003) | ACCESS Programming | EXCEL VB.Net Programming | EXCEL Spreadsheet Functions Material Management  |  Guestbook
 

ADO Error object: Source Property

Syntax

objErr.Source

Returns a string that is the name or ID of the object or application that generated the error.

The Source property returns a string value that is the name of the object or application that generated the error. Remember that errors can be generated by both ADO and the underlying data source (provider).
 
For ADO, the returned value will be of the format "ADO.objName" where objName is the name of the object that originated the error.

 

Example

For Each objError in objConnection
   ErrorInfo = "Description; " & objError.Description & VbCrLf &_
      "Help Context: " & objError.HelpContext & VbCrLf &_
      "Help File: " & objError.HelpFile & VbCrLf &_
      "Native Error: " & objError.NativeError & VbCrLf &_
      "Number: " & objError.Number & VbCrLf &_
      "Source: " & objError.
Source & VbCrLf &_
      "SQL State: " & objError.SQLState & VbCrLf

   Debug.Print ErrorInfo
Next