Troubleshooting errors within your ASP web application can be challenging sometimes. When working with ADO, the Error object can be used since it contains details about data access errors that have been generated during a single operation.

ADO will generate one Error object for each error. Each Error object contains details of the specific error. To access the errors, you must refer to a specific connection. Here is an example of how we can loop through the Errors Collection:

Syntax

objErr.property

Properties

Example

<% oConn.Execute sql if err<>0 then for each objErr in oConn.Errors response.write("

") response.write("”) response.write("”) response.write("”) response.write("”) response.write("”) response.write("”) response.write("”) response.write("
Description") response.write(objErr.Description & “
Help context") response.write(objErr.HelpContext & “
Help file") response.write(objErr.HelpFile & “
Native error") response.write(objErr.NativeError & “
Error number") response.write(objErr.Number & “
Error source") response.write(objErr.Source & “
SQL state") response.write(objErr.SQLState & “


") next else end if %>