Hi All,
I have script task designed to look if a .xls file exists or not. It works correctly when the file is in network folder, but when it doesn't the False path doesn't fire. It still thinks it should look for the file and produces a check object exists error.
Package uses two variables;
@BolFileExists, Package, Boolean, False
@strFileLocation, Package, String, D:\xxxx\yyyy\aa.xls
Script Task: Readonly User::strFileLocation, Read Write User::BolFileExists
I have script task designed to look if a .xls file exists or not. It works correctly when the file is in network folder, but when it doesn't the False path doesn't fire. It still thinks it should look for the file and produces a check object exists error.
Package uses two variables;
@BolFileExists, Package, Boolean, False
@strFileLocation, Package, String, D:\xxxx\yyyy\aa.xls
Script Task: Readonly User::strFileLocation, Read Write User::BolFileExists
Code:
Imports System.IO
Public Class ScriptMain
Public Sub Main()
Dts.Variables("BolFileExists").Value = File.Exists(Dts.Variables("strFileLocation").Value.ToString())
Dts.TaskResult = Dts.Results.Success
End Sub
End Class