Link to home
Start Free TrialLog in
Avatar of ametuer999
ametuer999

asked on

Refering Parent object

Set Package = DTSGlobalVariables.Parent
Set Steps = Package.Steps

I have the above code in one of my packages..i copied the same code in active x script task..i have no other go right now..my question is can i continue with the same code after migration also..means will this code refer to my migrated ssis package as parent...if not is there any other way to do this?..i really have lots of hopes on Expert-Exchange..any help ASAP..highly apppriciated..Thanks in advance..
Avatar of Steve Hogg
Steve Hogg
Flag of United States of America image

In DTS you could rely on ActiveX to enable and disable steps. It was the only way to Loop and end Loops. You could also handle the precedence in ActiveX. But in SSIS it is completely different. None of this is done in ActiveX. My suggestion is to rebuild the same logic in SSIS. Do you know the logic from the ActiveX script (understand it)?
Avatar of ametuer999
ametuer999

ASKER

Thank you ,no  i dont know..i am a new bee..can you please let me know how to do that...
Sure, let's walk through the entire requirement. What does the DTS Package do? This will be the outline for the new SSIS package.
Set Package = DTSGlobalVariables.Parent
Set Steps = Package.Steps
Let's start with the above, what are they being used for in the package?
this is the code i have,can you analyze and try to recode in vb.net
                                                                     
                                                                     
                                                                     
                                             
'**********************************************************************
'  Visual Basic ActiveX Script
'************************************************************************

Function Main()

' This makes sure that the text field ApplicationProfile in table BulkRequestDataLoad_CPoint matches field ProfileLable
' in table tbl_Profile for the application.

      Dim Package, Step, Steps
      Dim pkg
      Dim step1
      Dim step2

      ' First thing we need to do is to check if our directories are valid.
************************************************************************************************************************************
      SET pkg = DTSGlobalVariables.Parent

      SET step1= pkg.Steps("DTSStep_DTSExecuteSQLTask_5")
      SET step2 = pkg.Steps("DTSStep_DTSExecuteSQLTask_6")  '(how to refer like this after migration?)'
************************************************************************************************************************************
      If DTSGlobalVariables("gv_Profile").Value > 0 Then
            step1.DisableStep = False
            step2.DisableStep = False

            Main = DTSTaskExecResult_Success
      Else
            ' Check for valid ProID

            If isEmpty(DTSGlobalVariables("gv_ProID").Value) Then
                  call DisplayGlobals
                  stpDeleteNull.DisableStep = True
                  stpProcessBulkLoad.DisableStep = True
************************************************************************************************************************************
                  Set Package = DTSGlobalVariables.Parent   '(Is this code valid for migrated SSIS package also)'
                  Set Steps = Package.Steps
*************************************************************************************************************************************
                  For Each Step in Steps
                        Step.ExecutionStatus = DTSStepExecStat_Inactive
                  Next

                  Set Steps = Nothing
                  Set Package = Nothing

                  call DisplayGlobals

                  Main = DTSTaskExecResult_Failure
            Else
                  step.DisableStep = True
                  step.DisableStep = True

                  Set Package = DTSGlobalVariables.Parent
                  Set Steps = Package.Steps

                  For Each Step in Steps
                        Step.ExecutionStatus = DTSStepExecStat_Inactive
                  Next

                  call DisplayGlobals

                  Main = DTSTaskExecResult_Failure
            End If

      End If

End Function

Public Function DisplayGlobals ()
      'call DisplayGlobals

Dim msg, X

End Function


It appears all this code is doing is directing the flow. Can you tell me what the package needs to do? In SSIS we may not even need a vb.net script.task.
Thanks for responding even on weekends.
i cant simply explain the purpose in a few words..can you please guide me how to attach my ssis project ,which i have already migrated and stuck at this task..i tried to attach it..but i guess you cant open and look into it...thanks again for bearing with me..
I attach two packages with .txt extension.I think you can change the extension to .dtsx and view them..Import package calls Requests package as a child package..could you please have look and analyze
Import.txt
Requests.txt.txt
I will be looking at this tonight an tomorrow. Thanks.
Thanks In Advance HoggZilla...!
Sorry for the delay. I will get something to you today. :-)
no problem sir..take your time..i will be very grateful for you if you could make me learn a  solution to get out of this problem...THANK YOU....
Hi  could you please..........
I still need your help sir...
I am so sorry. I have been out of the office. Back today and I will get this done. Once again, very sorry.
Steve
No problem sir...
ASKER CERTIFIED SOLUTION
Avatar of Steve Hogg
Steve Hogg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial