Job Fail -
08-22-2003
, 08:28 AM
I have the following code where I am chechking the age of
the file. If file more then 24 hours then
DTSTaskExecResult_Failure.
In a job it stated - fail but in reality it is not. How do
I hadle this situation?
Function Main()
Dim fso, f, fc, f1, PName, FName
Set fso=CreateObject("Scripting.FileSystemObject")
rootDir="C:\"
If (fso.FileExists (rootDir & "\HW.TXT")= True) Then
Set File = fso.GetFile(rootDir & "\HW.TXT")
' Check age of file is less than 24 hours
If DateDiff("h", File.DateLastModified, Now ) <= 24 Then
Main = DTSTaskExecResult_Success
Else
Main = DTSTaskExecResult_Failure
End if
Else
Main = DTSTaskExecResult_Failure
end if
Set fso = Nothing
End Function |