Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2011
    Posts
    1

    Unanswered: vb6 throwing error "The specified DTS Package ('Name = 'GLI_DOWNLOAD_WRLN_SPCL_1'; ID

    I have inherted a vb6 application and haven't had to make changes other than server changes. Previous server changes have worked fine. Now we are upgrading from SQL 2005 TO SQL 2008 and doing a server upgrade as well.

    All the DTS packages have been converted to SSIS packages. The SSIS packages execute fine in BIDS and from Integrated Services within SQL 2008 under the 'Stored Packages\MSDB' folder when manually executed.

    We are now in the process of testing the server change and SQL upgrade. When the vb app is brought up and the option to execute a SSIS package from the drop down menus is selected the task appears to have worked but didn't.

    I stepped through the vb code and the error nbr is -2147217900 sErrDesc : "The specified DTS Package ('Name = 'GLI_DOWNLOAD_WRLN_SPCL_1'; ID.VersionID = {[not specified]}.{[not specified]}') does not exist." : String : cSQLSrvr.DTSTASK2

    I don't see where the SSIS packages have a version. When I right click on the package in Itegration Services no particular version shows up.

    The code being executed is:
    Public Function DTSTASK(TASK As String)

    Dim objPackage As dts.Package2
    Dim objStep As dts.Step
    Dim objTask As dts.TASK
    Dim objExecPkg As dts.ExecutePackageTask

    On Error GoTo ErrHandler

    Set objPackage = New dts.Package
    objPackage.FailOnError = True

    'Create the step and task. Specify the package to be run, and link the step to the task.
    Set objStep = objPackage.Steps.New
    Set objTask = objPackage.Tasks.New("DTSExecutePackageTask")
    Set objExecPkg = objTask.CustomTask

    With objExecPkg
    .ServerName = "server abc"
    .ServerUserName = "server name"
    .ServerPassword = "GLI1023tue"
    .PackageName = TASK 'name of the DTS Task
    .Name = "ExecPkgTask"
    End With


    With objStep
    .TaskName = objExecPkg.Name
    .Name = "ExecPkgStep"
    .ExecuteInMainThread = True
    End With

    objPackage.Steps.Add objStep
    objPackage.Tasks.Add objTask

    'Run the package and release references.
    objPackage.Execute

    Set objExecPkg = Nothing
    Set objTask = Nothing
    Set objStep = Nothing
    objPackage.UnInitialize

    RunDtsTask = True

    Exit Function

    ErrHandler:
    lErrNo = Err.Number
    sErrDesc = Err.Description
    Resume NextLine

    NextLine:
    On Error Resume Next
    Set objExecPkg = Nothing
    Set objTask = Nothing
    Set objStep = Nothing
    objPackage.UnInitialize
    On Error GoTo 0

    End Function

    Public Function DTSTASK2(TASK As String)

    Dim stp As dts.Step
    Dim pkg As dts.Package

    On Error GoTo ErrHandler

    Set pkg = New dts.Package
    pkg.LoadFromSQLServer _
    ServerName:="server abc", _
    ServerUserName:="server name", _
    ServerPassword:="GLI1023tue", _
    PackageName:=TASK


    For Each stp In pkg.Steps
    stp.ExecuteInMainThread = True
    Next

    pkg.FailOnError = True 'not sure about this one
    pkg.Execute
    Set pkg = Nothing

    Exit Function

    ErrHandler:
    lErrNo = Err.Number
    sErrDesc = Err.Description
    Resume NextLine

    NextLine:
    On Error Resume Next
    Set pkg = Nothing
    On Error GoTo 0
    End Function



    Please help!

  2. #2
    Join Date
    Aug 2011
    Posts
    2
    Very useful to me.
    Thank you.

Posting Permissions

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