ActiveX in SQL Server Enterprise Manager / DTS package

Posted on 2007-10-14
Last Modified: 2013-11-18
Hi Expert,

I created an ActiveX and that will be placed in a DTS package.  However, when I execute the activeX step, it errors out and give me an error message saying: "Microsoft Data Transformation Services (DTS) Package Task 'Trnasform data Task: Rsult' was not fould"

Below is the activeX script.  Thank you for your help.

Paul, CA, USA

'  Visual Basic ActiveX Script

Function Main()

      ' Declare result strings to assign to globals .

      Dim strResultSQL
      Dim strStartDate, strEndDate
      ' Declare package object
      Dim oPackage

      ' Build up the Date ranges required
      strStartDate = "'" & DTSGlobalVariables("LoadStartDate").Value & "'"
      strEndDate = "'" & DTSGlobalVariables("LoadEndDate").Value & "'"

      ' Declare select statements.      
      strSQL_RESULTS_SELECT = "SELECT * FROM RESULT DATE_TIME>= "  & strStartDate  & " AND DATE_TIME<= "  & strEndDate  & " "

      ' Construct full SQL statements

      strResultSQL = strSQL_RESULT_SELECT
      ' Assign constructed SQL String to pump objects.

      SET oPackage = DTSGlobalVariables.Parent
      SET oPump = oPackage.Tasks("Transform Data Task:  Result").CustomTask
      oPump.SourceSQLStatement =       strResultSQL
      SET oPackage = Nothing

      Main = DTSTaskExecResult_Success
End Function
Question by:gtetran
    1 Comment
    LVL 19

    Accepted Solution

    i'm assuming it fails at
    SET oPump = oPackage.Tasks("Transform Data Task:  Result").CustomTask

    try replaciing "Transform Data Task:  Result" with the dts task number of that task (off the top of my head, go to file>disconnected edit and then look for the ID number, or if you have workflow tasks in the package, click the workflow of that task, then scroll through the tabs and the task ID should be appear.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.
    Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now