ADO Error Object

Οντότητα Error

Η οντότητα Error ADO περιέχει λεπτομέρειες σφαλμάτων πρόσβασης που σχετίζονται με μια συγκεκριμένη λειτουργία (σχετική στον πάροχο).

Το ADO δημιουργεί έναν οντότητα Error για κάθε σφάλμα. Κάθε οντότητα Error περιέχει λεπτομέρειες του συγκεκριμένου σφάλματος και οι οντότητες Error αποθηκεύονται στο σύνολο Errors. Για να προσέξουμε αυτά τα σφάλματα, πρέπει να αναφέρεσαι σε μια συγκεκριμένη σύνδεση.

Κύκλος εξερεύνησης του συνόλου Errors:

<%
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
%>

Syntax

objErr.property

Property

Property Description
Description Return a description of the error.
HelpContext Return the content ID of a topic in the Microsoft Windows help system.
HelpFile Return the complete path to the help file in the Microsoft Windows help system.
NativeError Return the error code from the provider or data source.
Number Return a unique number that can identify the error.
Source Return the name of the object or application that caused the error.
SQLState Return a 5-character SQL error code.