If you're using ADO, then as part of the connection object, there is a collection of error objects which contain information about ADO errors. You can walk thru this error collection in your normal error handler with code similar to the following: (gADO_Connect is the ADO Connection Object). Although its not used in this code, the ADO Error Ojbect also has a number property.
Dim lRst_Error As ADODB.Error
lStr_NewLine = vbCrLf & vbTab & Space(3) ' Custom New Line
If (gADO_Connect.Errors.Count > 0) Then
For Each lRst_Error In gADO_Connect.Errors
With lRst_Error
lStr_ErrDesc = vbNullString
lStr_ErrParts = Split(.Description, "]"

For lInt_Idx = 0 To UBound(lStr_ErrParts)
lStr_ThisErr = Trim(lStr_ErrParts(lInt_Idx))
If (Left(lStr_ThisErr, 1) = "["

Then
lStr_ThisErr = lStr_ThisErr & "]"
End If
lStr_ErrDesc = lStr_ErrDesc & lStr_ThisErr & lStr_NewLine
Next lInt_Idx
lStr_Msg = lStr_Msg & lStr_ErrDesc & lStr_NewLine & _
"(Source" & vbTab & vbTab & ": " & .Source & "

" & lStr_NewLine & _
"(SQL State" & vbTab & ": " & .SQLState & "

" & lStr_NewLine & _
"(NativeError" & vbTab & ": " & .NativeError & "

" & vbCrLf
End With
Next
Set lRst_Error = Nothing
Else
' Not an ADO Error - so handle normally
End If
Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein