Quick References
ADO
ASP
CSS2
HTML
JavaScript
Jet SQL
VBScript
WML
WMLScript
WSH
XHTML
XML DOM
XSLT
Features
Knowledge Base
Tutorials
Partners
ZVON.ORG
XML
Planet Source Code
VisualBuilder
Web Design
Your HTML Source
XML/XSLT Forums
ASPAlliance
Scripts
Programmers Heaven
Tek-Tips Forums
Developer Fusion
Code Project
DataControl SQL Property
Error Object
PROPERTY: Error::SQLState
long =
errorobject.
SQLState
The
SQLState
property is a string that contains the five-character SQL error code that is returned by the provider when an error occurs during the execution of an SQL command (query).
The SQL error codes are supposed to follow at least the minimum standards established by the "SQL Access Group." However, providers can vary greatly as to which portions of the SQL standards they recognize. You will need to consult the SQL documentation that is usually available from the provider in order to interpret the error code. Some SQL errors may not have a code and the returned value will be blank.
Code (VBScript):
For Each objError in objConnection
ErrorInfo = "Description; " & objError.Description & VBCRLF &_
"Help Context: " & objError.HelpContext & VBCRLF &_
"Help File: " & objError.HelpFile & VBCRLF &_
"Native Error: " & objError.NativeError & VBCRLF &_
"Number: " & objError.Number & VBCRLF &_
"Source: " & objError.Source & VBCRLF &_
"SQL State: " & objError.
SQLState
& VBCRLF
Response.Write ErrorInfo
Next
Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information