ADO Error 對(duì)象
ADO Error 對(duì)象為你提供數(shù)據(jù)訪問(wèn)錯(cuò)誤的信息。
Error 對(duì)象
ADO Error 對(duì)象包含與單個(gè)操作(涉及提供者)有關(guān)的數(shù)據(jù)訪問(wèn)錯(cuò)誤的詳細(xì)信息。
ADO 會(huì)因每次錯(cuò)誤產(chǎn)生一個(gè) Error 對(duì)象。每個(gè) Error 對(duì)象包含具體錯(cuò)誤的詳細(xì)信息,且 Error 對(duì)象被存儲(chǔ)在 Errors 集合中。要訪問(wèn)這些錯(cuò)誤,就必須引用某個(gè)具體的連接。
循環(huán)遍歷 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
%>
語(yǔ)法
屬性
屬性 | 描述 |
Description | 返回一個(gè)錯(cuò)誤描述。 |
HelpContext | 返回 Microsoft Windows help system 中某個(gè)主題的內(nèi)容 ID。 |
HelpFile | 返回 Microsoft Windows help system 中幫助文件的完整路徑。 |
NativeError | 返回來(lái)自 provider 或數(shù)據(jù)源的錯(cuò)誤代碼。 |
Number | 返回可標(biāo)識(shí)錯(cuò)誤的一個(gè)唯一的數(shù)字。 |
Source | 返回產(chǎn)生錯(cuò)誤的對(duì)象或應(yīng)用程序的名稱。 |
SQLState | 返回一個(gè) 5 字符的 SQL 錯(cuò)誤碼。 |
在下一節(jié)內(nèi)容中,你將了解有關(guān) ADO Field 對(duì)象的內(nèi)容。
更多建議: