Trouble trying to debug Script Task

  • ***** Spotted the mistake ...... More Sleep Needed 😉

    I have a variable

    Name - "IsRunning"

    Scope - Project Name

    Data Type - Boolean

    Value - False

    In the design Window if i execute a Script Task ( code below ) i get a Task Failed. Can someone point out where im going wrong ??

    Public Sub Main()

    If Dts.Variables("IsRunning").Value = False then

    Dts.TaskResult = Dts.Results.Failure

    exit Sub

    end if

    Dts.TaskResult = Dts.Results.Success

    End Sub

    I would expect the task to complete with a success ??

  • It works if this change is made

    If CType(Dts.Variables("IsRunning").Value, Boolean) = False

    Norman

    DTS Package Search

    http://www.dtspackagesearch.com/

  • Is it this variable added to ReadWriteVariables list (Script option of Script Task)?

  • Thanks Guys, I managed to sort it 🙂

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply