Classic ASP中的错误处理 [英] Error handling in Classic ASP

查看:85
本文介绍了Classic ASP中的错误处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在经典ASP中可以使用哪些方法进行错误处理?

解决方案

嗨公主,



以下是一些可以帮助您的链接:

ASP中的错误处理 [ ^ ]

ASP和错误处理程序 [ ^ ]

如何在我的网站上记录/跟踪ASP错误? [ ^ ]



希望它有所帮助!


这是一个解决方案



错误恢复下一个



设置RSDist = objCmd .Execute()'任何错误命令

CheckError'检查数据库错误的函数

如果session(TransError)=Y则response.end



错误转到0



函数CheckError()

session(TransError) =N

如果Err.Number<> 0然后

Response.write(


Response.write(




Response.write(

Response.write(遇到错误执行报告/流程;



Response.write(



Response.write(



Response.write( < span style =color:rgb(0,0,0)>)

Response.write(错误明细:& Err.Description)

< br $>


session(TransError)=Y

conn.RollbackTrans

Response.End
结束如果

结束功能





What are the ways in which error handling can be done in Classic ASP?

解决方案

Hi Princess,

Here are few links that will help you out:
Error Handling in ASP [^]
ASP and the Error Handler[^]
How do I log / track ASP errors on my web site?[^]

Hope it helps!


Here is a solution

on error resume next

set RSDist = objCmd.Execute() ' any error command
CheckError 'Function to check Database Errors
if session("TransError")="Y" then response.end

on error goto 0

function CheckError()
session("TransError")="N"
if Err.Number <> 0 then
Response.write("
")
Response.write("



")
Response.write("")
Response.write ("An error is encountered during the execution of the report/process;

")
Response.write ("

")
Response.write("
")
Response.write("")
Response.write ("Error Detail: "&Err.Description)


session("TransError")="Y"
conn.RollbackTrans
Response.End
end if
end function






这篇关于Classic ASP中的错误处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆