Function Main() dim strFeedFileName Const ForReading = 1, ForWriting = 2, ForAppending = 8 Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0 strFeedFileName = DTSGlobalVariables("gFeedFileName").Value ' Check if file exists and size is > 0 and not a junk by checking first line Dim fs, f, s, t, strData, strAllocDate Set fs = CreateObject("Scripting.FileSystemObject") if not fs.FileExists(strFeedFileName) then err.Raise 12345,"CRS-" & DTSGlobalVariables("gAccountType").Value & "-DataUpload DTS Package", " Extract file not found! Cannot proceed. " & strFeedFileName Main = DTSTaskExecResult_Failure Exit function else Set f = fs.GetFile(strFeedFileName) if not f.Size > 0 then err.Raise 12346,"CRS-" & DTSGlobalVariables("gAccountType").Value & "-DataUpload DTS Package", " Extract file empty! Cannot proceed." Main = DTSTaskExecResult_Failure Exit function end if end if set fs = nothing 'to execute the DTS event start values Main = DTSTaskExecResult_Success End Function
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)