ADO Error 對象
Error 對象
ADO Error 對象包含與單個(gè)操作(涉及提供者)有關(guān)的數(shù)據(jù)訪問錯(cuò)誤的詳細(xì)信息。
ADO 會因每次錯(cuò)誤產(chǎn)生一個(gè) Error 對象。每個(gè) Error 對象包含具體錯(cuò)誤的詳細(xì)信息,且 Error 對象被存儲在 Errors 集合中。要訪問這些錯(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 %>
語法
objErr.property
屬性
屬性 | 描述 |
---|---|
Description | 返回一個(gè)錯(cuò)誤描述。 |
HelpContext | 返回 Microsoft Windows help system 中某個(gè)主題的內(nèi)容 ID。 |
HelpFile | 返回 Microsoft Windows help system 中幫助文件的完整路徑。 |
NativeError | 返回來自 provider 或數(shù)據(jù)源的錯(cuò)誤代碼。 |
Number | 返回可標(biāo)識錯(cuò)誤的一個(gè)唯一的數(shù)字。 |
Source | 返回產(chǎn)生錯(cuò)誤的對象或應(yīng)用程序的名稱。 |
SQLState | 返回一個(gè) 5 字符的 SQL 錯(cuò)誤碼。 |
上一篇: 您已經(jīng)學(xué)習(xí)了 ASP,下一步學(xué)習(xí)什么內(nèi)容呢? 下一篇: ADO 查詢