ADO Error object - NativeError Property

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

Error object: NativeError Property

Syntax

objErr.NativeError

Returns a long value that is the database error information for a specific Error object.

The NativeError property is a long value that is an error code that is returned to ADO by the data source or the provider when an error occurs. ADO uses the NativeError property to allow access to this underlying error code.
 
You will have to refer to the data source/provider documentation for an explanation of the returned error code.

 

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