elucero
asked on
check filesize in ssis 2005
Hi, I'm pretty new to ssis script task, I would like to know how I can check the file size's in the following code and if it's 0 then fail it. I'm using ssis 2005.
Public Sub Main()
Dim pErrorMessage As String
Dim i As Integer
Dim FileName As String
For i = 0 To Dts.Variables.Count - 1
If Dts.Variables(i).Name <> "ErrorMessage" Then
FileName = CType(Dts.Variables(i).Val ue, String)
If (My.Computer.FileSystem.Fi leExists(F ileName) = False) Then
pErrorMessage = pErrorMessage + " " + FileName + " does not exist, "
End If
End If
Next
If pErrorMessage = "" Then pErrorMessage = "NOERROR"
'MsgBox(pErrorMessage)
Dts.Variables("ErrorMessag e").Value = pErrorMessage
End Sub
Public Sub Main()
Dim pErrorMessage As String
Dim i As Integer
Dim FileName As String
For i = 0 To Dts.Variables.Count - 1
If Dts.Variables(i).Name <> "ErrorMessage" Then
FileName = CType(Dts.Variables(i).Val
If (My.Computer.FileSystem.Fi
pErrorMessage = pErrorMessage + " " + FileName + " does not exist, "
End If
End If
Next
If pErrorMessage = "" Then pErrorMessage = "NOERROR"
'MsgBox(pErrorMessage)
Dts.Variables("ErrorMessag
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.