ADO SQLState 属性

定义和用法

SQLState 属性可返回一个字符串,该字符串包含由提供者返回的五个字符的 SQL 错误代码。

语法

  1. strErrorSQL=objErr.SQLState

实例

  1. <%
  2. for each objErr in objConn.Errors
  3. response.write("<p>")
  4. response.write("Description: ")
  5. response.write(objErr.Description & "<br />")
  6. response.write("Help context: ")
  7. response.write(objErr.HelpContext & "<br />")
  8. response.write("Help file: ")
  9. response.write(objErr.HelpFile & "<br />")
  10. response.write("Native error: ")
  11. response.write(objErr.NativeError & "<br />")
  12. response.write("Error number: ")
  13. response.write(objErr.Number & "<br />")
  14. response.write("Error source: ")
  15. response.write(objErr.Source & "<br />")
  16. response.write("SQL state: ")
  17. response.write(objErr.SQLState & "<br />")
  18. response.write("</p>")
  19. next
  20. %>