''''******************************************************
''''
''''关闭错误日志文件
''''
''''******************************************************
Close #intErrLogFileHandle
在某个Module中添加:
''''******************************************************
''''
''''写入错误日志
''''
''''******************************************************
Public Sub WriteErrLogFile(ByVal strSub As String, ByVal strErr As String)
Print #intErrLogFileHandle, Date, Time, strSub, strErr
End Sub
在每个过程或自定义的函数中,使用如下的系统错误捕获机制:
Public Function ForExample(…………) As Long
On Error Goto FuncError
ForExample=True
………………………
………………………
Exit Function
FuncError:
ForExample=False
WriteErrLogFile " ForExample ", "错误号:" & Err.Number & ",错误源:" & Err.Source & ",错误描述:" & Err.Description
MsgBox "……… ", vbCritical
''''在此作内存资源回收工作
End Function
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




