Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 438
  • Last Modified:

ActiveX in SQL Server Enterprise Manager / DTS package

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.      
      Dim strSQL_RESULT_SELECT
      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
_______________________________
0
gtetran
Asked:
gtetran
1 Solution
 
frankyteeCommented:
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.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now