No, I am not re-reading in the ini settings.
Here is the code for loading ini settings:
Private Function IniExists() As Boolean
On Error GoTo ErrorHandler
If Dir(App.Path & "\" & IniFileName, vbNormal) = "" Then
ErrorMessage = "The ini file was not present. A blank ini file has been created so that you can add the program parameters."
IniExists = False
Else
IniExists = True
End If
Exit Function
ErrorHandler:
ErrorMessage = "A Error has occured while locating the ini file."
logger.WriteError logger.PROD_LOGGING
IniExists = False
End Function
Private Function LoadSettings() As Boolean
On Error GoTo ErrorHandler
'read the values into the collection
Dim eqPos As Integer
Dim strLen As Integer
Dim fHandle As Integer
Dim CurLine As String
fHandle = FreeFile()
Open App.Path & "\" & IniFileName For Input As #fHandle
While Not EOF(fHandle)
Input #fHandle, CurLine
If Not (Left(CurLine, 1) = "[" Or CurLine = "" Or CurLine = ";") Then
strLen = Len(CurLine)
eqPos = InStr(1, CurLine, "=", vbTextCompare)
IniSettings.Add Right(CurLine, strLen - eqPos), Left(CurLine, eqPos - 1)
End If
Wend
Close (fHandle)
LoadSettings = True
Exit Function
ErrorHandler:
ErrorMessage = "A Error has occured while loading the ini file."
logger.WriteError logger.PROD_LOGGING
LoadSettings = False
End Function
Public Function GetIniValue(IniKey As String) As String
GetIniValue = IniSettings(IniKey)
End Function
I have temporarily resolved the problem and here is how?????????
IN the timer interval I have put two lines of code and it has seemed to work. Don't think this is a resolution, but let me know what you think for a permanent solution.
Do While newFile <> "" ' Start the loop.
If newFile <> "." And newFile <> ".." Then
If UCase(newFile) = PACKS_FILE_NAME Then
If FileWorker.ProcessFile(newFile) Then
logger.WriteString "File: " & FileWorker.NewFileName & " has been processed successfully", logger.PROD_LOGGING
'Next two lines of code were added to resolve the issue of the the
'application failing after midnight. RDS 12-01-04
newFile = ""
newFile = Dir(FileWorker.GetIncomingDir, vbDirectory)
Else
logger.WriteString newFile & " has not complete successfully: ", logger.PROD_LOGGING
'Next two lines of code were added to resolve the issue of the the
'application failing after midnight. RDS 12-01-04
newFile = ""
newFile = Dir(FileWorker.GetIncomingDir, vbDirectory)
End If
Else
FileWorker.ArchiveFile (newFile)
End If
End If
newFile = Dir ' Get next entry.
Loop