ADO Number Property
Definition and Usage
The Number property indicates the unique number that identifies the Error object.
Returns a Long value that may correspond to an ErrorValueEnum constant.
Use the Number property to determine which error occurred. The value of the property is a unique number corresponding to the error condition.
The Errors collection returns HRESULT in hexadecimal format (e.g., 0x80004005) or as a Long value (e.g., 2147467259). These HRESULTs are generated by basic components such as OLE DB, even by OLE itself.
Syntax
lngErrorNumber=objErr.Number
Example
<% for each objErr in objConn.Errors response.write("<p>") response.write("Description:") response.write(objErr.Description & "<br/>") response.write("Help context:") response.write(objErr.HelpContext & "<br/>") response.write("Help file:") response.write(objErr.HelpFile & "<br />") response.write("Native error: ") response.write(objErr.NativeError & "<br />") response.write("Error number: ") response.write(objErr.Number & "<br />") response.write("Error source: ") response.write(objErr.Source & "<br />") response.write("SQL state: ") response.write(objErr.SQLState & "<br />") response.write("</p>") next %>