谁知道asp页面如果运行过程出错了~~怎么回收出错的信息?

zzznzzzz 2005-03-29 11:54:52
我找到的:
if Err.number<>0 then
Response.Write "出错:"&Err.description
Response.Write "<br>"
Response.End
end if


有大哥详细讲解下!或者有更详细的资料么?
...全文
73 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
winstarr 2005-03-29
  • 打赏
  • 举报
回复
if Err.number<>0 then
Response.Write "出错:"&Err.description
Response.Write "<br>"
Response.End
end if

Err.number 为0 时没有错误。
mymyal123 2005-03-29
  • 打赏
  • 举报
回复
一般是在打开记录集的时候加上以上代码,用于判断是否成功打开,如果出错则返回出错类型
myvicy 2005-03-29
  • 打赏
  • 举报
回复
ASPError Object
You can use the ASPError object to obtain information about an error condition that has occurred in an ASP script. The ASPError object is returned by the Server.GetLastError method. The ASPError object exposes read-only properties.

Syntax
ASPError.property

Properties
ASPCode Returns an error code generated by IIS.
Number Returns the standard COM error code.
Source Returns the actual source code, when available, of the line that caused the error.
Category Indicates if the source of the error was internal to ASP, the scripting language, or an object.
File Indicates the name of the .asp file that was being processed when the error occurred.
Line Indicates the line within the .asp file that generated the error.
Column Indicates the column position within the .asp file that generated the error.
Description Returns a short description of the error.
ASPDescription Returns a more detailed description of the error if it is an ASP-related error.

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧