% '*********************************************************************** ' Comments : Calls stored proc to write event log ' Parameters : strLogText = General comments to log ' strLogType = a way of grouping messages ' strLogData = might be used for SQL?, etc ' Returns : nothing (just writes HTML) ' Created : Enterprise Software Solutions [08/01/2002] ' Modified : '*********************************************************************** Sub SetApplication(strApplication) Session("Application") = strApplication End Sub %> <% '*********************************************************************** ' Comments : Gets the current path ' Parameters : none ' Returns : The current path ' Created : Enterprise Software Solutions [01/03/2003] ' Modified : '*********************************************************************** Public Function CurrentPath() Dim strThisFileName Dim strPath Dim aPathArray '***** the server variable will include the file name, so remove it strPath = Request.ServerVariables("PATH_TRANSLATED") 'the filename is the last piece following the last "\" aPathArray = Split(strPath,"\") strThisFileName = aPathArray(uBound(aPathArray)) strPath = Replace(strPath, strThisFileName, "") 'return the path CurrentPath = strPath End Function %> <% '*********************************************************************** ' Comments : Keeps an event log ' Parameters : text to log, a description of log enent type, misc data ' Returns : nothing ' Created : Enterprise Software Solutions [05/26/1999] ' Modified : '*********************************************************************** Public Sub LogEvent(strLogText, strLogType, strLogData) On Error Resume Next If Not(Application("EnableLog")) = True Then 'the log is disabled Exit Sub End If Dim objFileSystem Dim objFileHandle Const ForReading = 1 Const ForAppending = 8 'this const Opens the file as ASCII Const TristateFalse = 0 Dim strLogFilePath 'get path of log file strLogFilePath = CurrentPath() & "TempFiles\" & Session("Application") & ".log" 'create the file object Set objFileSystem = server.CreateObject("Scripting.FileSystemObject") 'initialize event log file If objFileSystem.FileExists(strLogFilePath) = True Then Set objFileHandle = objFileSystem.OpenTextFile(strLogFilePath, _ ForAppending, TristateFalse) Else 'create new log file Set objFileHandle = objFileSystem.CreateTextFile(strLogFilePath) objFileHandle.WriteLine ("This is the Event Log file for " & Session("Application") _ & ". The format is : [TimeStamp]" _ & " ==> [ClientUserName (NULL=Anonymous)]" _ & " ==> [ClientMachineName]" _ & " ==> [Session]" _ & " ==> [Log Text] ==> [Log Type] ==> [Log Data]") 'use applicating logging also End If 'log the event Call objFileHandle.WriteLine(Now() _ & " ==> " & Request.ServerVariables("LOGON_USER") _ & " ==> " & Request.ServerVariables("REMOTE_ADDR") _ & " ==> " & Session.SessionID _ & " ==> " & strLogText & " ==> " & strLogType & " ==> " & strLogData) On Error Resume Next 'close the event log and clean up objFileHandle.Close Set objFileHandle = Nothing Set objFileSystem = Nothing Err.Clear End Sub %> <% '*********************************************************************** ' Comments : Build the HTML table (Naviage method) ' Parameters : "^" row, Pipe delimted colums table data ' TableProperties and CellTextProperties ' bHasHeader = send "True" to make the first row a header ' Returns : "OK" if all information is ready to submit ' or "^" row, Pipe delimted colums set of allocations ' or Pipe delimited error message ' Created : Enterprise Software Solutions [08/01/2002] ' Modified : '*********************************************************************** Sub MakeTable(strTableData, strTableProperties, strCellTextProperties, bHasHeader) 'write call to the log Call LogEvent("MakeTable","Call", _ "strTableData=" & strTableData _ & "| strTableProperties=" & strTableProperties _ & "| strCellTextProperties=" & strCellTextProperties) 'initialize Response.Write vbcrlf & "
" Response.Write Trim(aFieldArray(i)) Response.Write " | "
else
Response.Write "" Response.Write Trim(aFieldArray(i)) Response.Write " | "
End If
Next
Response.Write vbcrlf & vbTab & "
|---|