ADO Errorオブジェクト
Error オブジェクト
ADO Error オブジェクトには、プロバイダーに関連する単一の操作に関するデータアクセスエラーの詳細情報が含まれます。
ADO はエラーごとに 1 つの 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
%>
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
%>
構文
objErr.property
プロパティ
| プロパティ | 説明 |
|---|---|
| Description | エラーの説明を返します。 |
| HelpContext | Microsoft Windows ヘルプシステム内のトピックのコンテンツ ID を返します。 |
| HelpFile | Microsoft Windows ヘルプシステム内のヘルプファイルの完全なパスを返します。 |
| NativeError | プロバイダーまたはデータソースからのエラーコードを返します。 |
| Number | エラーを識別する一意の番号を返します。 |
| Source | エラーを発生させたオブジェクトまたはアプリケーションの名前を返します。 |
| SQLState | 5 文字の SQL エラーコードを返します。 |