DTSGlobalVariables.Parent not persisting between functions & ActiveX error

  • Hello,

    we have a piece of VBScript code in a large number of DTS packages that normally works on all of our servers. However one particular, newly built, server is failing with ActiveX error

    "ActiveX Scripting encountered a Run Time Error during the execution of the script."

    The error comes up when trying to access objTask.Assignments so I would hazard a guess that

    Set objTask = objPackage.Tasks(7).CustomTask

    is also failing or doesn't work. As this works elsewhere in the environment I would appreciate any suggestions on what to check ... Thank you.

    Function Main()

    Dim objTask

    Dim objAssignment

    ' Get handle on package

    Set objPackage = DTSGlobalVariables.Parent

    ' Get the Read INI File Task & Assignments

    Set objTask = objPackage.Tasks(7).CustomTask

    For Each objAssignment In objTask.Assignments

    objAssignment.SourceIniFileFileName = sDTSGlobalVariables("g_DtsIniFile").Value

    Next

    End Function

  • This was being run against a 2005 database. The 2000 compatibility pack seems to have done the trick.

Viewing 2 posts - 1 through 2 (of 2 total)

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