On Error Resume Next
Set rstResult=cnnDb.Execute(strSQL)
If cnnDb.Errors.Count=0 Then
' show the result
Else
' handle the error
End If
On Error Goto 0
-----------------------
On Error Resume Next
Set xmlDoc = CreateObject("MSXML.DOMDocument")
if Err.number<>0 then
MsgBox "failed to create MSXML,error:" & err.description
Set xmlDoc = nothing
On Error GoTo 0
else
MsgBox "success to create MSXML object"
end if

博客展示了ASP代码中执行SQL语句和创建MSXML对象时的错误处理。执行SQL时通过判断数据库错误计数处理结果;创建MSXML对象时,若创建失败给出错误提示,成功则提示创建成功。
396

被折叠的 条评论
为什么被折叠?



