Visual Basic Codes
ActiveX
Miscellaneous
Applications
Code Snippets
Common Dialogs
Special Effects
Database Stuff
Date Time
Files Drives
Forms
Graphics Games
Internet Stuff
Multimedia
Other
Strings
Windows
Visual Basic > Internet Web Mail Stuff sample source codes
Use a logging file
Use a logging file Just wanted to give you the code for the error_log that I have written thanks to tips from you. If you think it would be useful you can put it up on the website. This is real simple, and the file is kept open for the full session, that the application is running. It is called by putting in the following call in the login or first form of the application Setup_Error_Log and calling the Close_Error_Log when exiting the application. Public sub Setup_Error_Log() Dim strErrorLog as String On Error GoTo ErrSetup_Error_log strErrorLog = App.Path & "\" & App.EXEName & ".log" If Dir(strErrorLog) <> "" Then Kill strErrorLog intFileNum = FreeFile Open strErrorLog For output as intFileNum Exit Sub ErrSetup_Error_log: MsgBox "error " & Err & Err.Description End Sub Public sub Close_Error_Log() Close #intFileNum End Sub Return
Privacy Policy
|
Link to Us
|
Links