Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

ADO 错误 对象


错误对象

ADO 错误对象包含有关在单个操作期间生成的 data access 错误的详细信息。 

ADO 为每个错误生成一个 Error 对象。每个 Error 对象都包含特定错误的详细信息,并存储在 Errors 集合中。要访问错误,必须引用特定连接。

要循环遍历 Errors 集合

<%
for each objErr in objConn.Errors
  response.write("<p>")
  response.write("描述: ")
  response.write(objErr.Description & "<br>")
  response.write("帮助上下文: ")
  response.write(objErr.HelpContext & "<br>")
  response.write("帮助文件: ")
  response.write(objErr.HelpFile & "<br>")
  response.write("原生错误: ")
  response.write(objErr.NativeError & "<br>")
  response.write("错误编号: ")
  response.write(objErr.Number & "<br>")
  response.write("错误来源: ")
  response.write(objErr.Source & "<br>")
  response.write("SQL 状态: ")
  response.write(objErr.SQLState & "<br>")
  response.write("</p>")
next
%>

语法

objErr.property

属性

属性 描述
描述 返回错误描述
HelpContext 返回 Microsoft Windows 帮助系统中主题的上下文 ID
HelpFile 返回 Microsoft Windows 帮助系统中帮助文件的完整路径
NativeError 返回提供程序或数据源的错误代码
Number 返回一个唯一数字,标识该错误
Source 返回生成该错误的对象或应用程序的名称
SQLState 返回一个 5 个字符的 SQL 错误代码

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.