<%@ LANGUAGE="VBScript" %>
<% '设置buffer为True
Response.Buffer = True
'开始错误处理
On Error Resume Next
%>
<% '错误处理
If Err.Number <> 0 Then
'清除页面
Response.Clear
'显示错误信息给用户
%>
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY BGCOLOR="#C0C0C0">
<FONT FACE="ARIAL">An error occurred in the execution of this ASP page<BR>
Please report the following information to the support desk<P>
<B>Page Error Object</B><BR>
错误 Number: <%= Err.Number %><BR>
错误信息: <%= Err.Description %><BR>
出错文件: <%= Err.Source %><BR>
出错行: <%= Err.Line %><BR>
</FONT>
</BODY>
</HTML>
<%End If%>
If Err.Number = 0 And objConnection.Errors.Count = 0 Then '这里才能执行语句,因为没有错误 Set rstResults = dbData.Execute(txtSql) End If
<%
If Err.Number <> 0 Then
Response.Clear
Select Case Err.Number
Case 8 '指定错误的Number
'在这里处理自定义错误
Case Else '一般错误
If IsObject(objConnection) Then
If objConnection.Errors.Count > 0 Then
%>
<B>Database Connection Object</B>
<% For intLoop = 0 To objConnection.Errors.Count - 1 %>
Error No: <%= objConnection.Errors(intLoop).Number %><BR>
Description: <%= objConnection.Errors(intLoop).Description %><BR>
Source: <%= objConnection.Errors(intLoop).Source %><BR>
SQLState: <%= objConnection.Errors(intLoop).SQLState %><BR>
NativeError: <%= objConnection.Errors(intLoop).NativeError %><P>
<% Next
End If
End If
If Err.Number <> 0 Then
%>
<B>Page Error Object</B><BR>
Error Number <%= Err.Number %><BR>
Error Description <%= Err.Description %><BR>
Source <%= Err.Source %><BR>
LineNumber <%= Err.Line %><P>
<% End If
End Select
End If
%>
If Err.Number = 0 And objConnection.Errors.Count = 0 Then Response.Clear Response.Redirect ?lt;URL Here>? End If
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有