ADO NativeError 屬性
定義和用法
NativeError 屬性可返回一個(gè) long 值,該值是由提供者或數(shù)據(jù)源返回 ADO 的錯誤代碼。
使用 NativeError 屬性對某個(gè) Error 對象檢索數(shù)據(jù)庫特有的錯誤信息。例如,當(dāng)配合使用 Microsoft ODBC Provider for OLE DB 和 Microsoft SQL Server 數(shù)據(jù)庫時(shí),從 SQL Server 產(chǎn)生的原生錯誤代碼將通過 ODBC 和 ODBC Provider 傳遞到 ADO NativeError 屬性。
語法
lngErrorNative=objErr.NativeError
實(shí)例
<%
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
%>