Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    119

    Unanswered: Error in executing a DTS Package from Visual Basic

    Hi! Good Day!

    I am executing a DTS PAckage from Visual Basic. My code is this:

    objPackage.LoadFromSQLServer "SERVER", , , _
    DTSSQLStgFlag_UseTrustedConnection, , , , "DTSPackage1"
    objPackage.Execute

    objPackage.LoadFromSQLServer "SERVER", , , _
    DTSSQLStgFlag_UseTrustedConnection, , , , "DTSPackage2"
    objPackage.Execute

    The first DTS package was executed successfully, but when it hit the second package, an error occurs:

    Step 'DTSStep_DTSDataPumpTask_1' already exists in the collection.

    Please help.
    Thanks.

  2. #2
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250
    hi

    try this

    dim objPackage as DTS.Package

    set objPackage = new DTS.Package
    objPackage.LoadFromSQLServer "SERVER", , , _
    DTSSQLStgFlag_UseTrustedConnection, , , , "DTSPackage1"
    objPackage.Execute

    set objPackage = nothing

    set objPackage = new DTS.Package

    objPackage.LoadFromSQLServer "SERVER", , , _
    DTSSQLStgFlag_UseTrustedConnection, , , , "DTSPackage2"
    objPackage.Execute



    hope this will solve the problem
    Cheers....

    baburajv

  3. #3
    Join Date
    Oct 2005
    Posts
    119
    Hi baburajv,

    My DTS packages are working well now.
    Thank you so much for your help.

    God bless

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •