Error defining DTS Package object in ASP/VBScript

  • I copied the following code almost verbatim from MS's article on how to run a DTS package from an ASP page using VBScript:

    Dim objPkg, strError, iCount
    Const DTSSQLStgFlag_Default = 0
    Const DTSStepExecResult_Failure = 1
    'Create and Execute the package
    Set objPkg = Server.CreateObject("DTS.Package")
     
    objPkg.LoadFromSQLServer "<Server>", "<Userid>", "<password>", _ DTSSQLStgFlag_Default,"","","","<Package Name>"
     
    objPkg.Execute
     
    'Check For Errors
    For iCount = 1 To objPkg.Steps.Count
         If objPkg.Steps(iCount).ExecutionResult = DTSStepExecResult_Failure   Then
             strError = strError + objPkg.Steps(iCount).Name + " failed. " + chr(13)
         End If
    Next
    If strError = "" then
        Response.Write "Success"
    Else
        Response.Write strError
    End if
    set objPkg = Nothing

    The code fails in the Server.CreateObject statement with:

    Active Server Pages error 'ASP 0241'
    CreateObject Exception
    /videoconference/upload.asp
    The CreateObject of '(null)' caused exception C0000005.
    Server object error 'ASP 0177 : c0000005'
    Server.CreateObject Failed
    /videoconference/upload.asp, line 34
    c0000005

    "DTS.Package" is not listed in any of my ASP docs or books as a valid object. My IIS server and SQL server are on different boxes. Do I need to do something to tell my IIS server about DTS?

     

     

  • You need to register the Microsoft DtsPackage Object Library on the server that you are trtying to create the object on.

    If you look at MSDN, or http://www.sqldts.com they tell you how to install the libraries on a server without having to install sql server and all the other components.

    See http://www.sqldts.com/default.aspx?207


    ------------------------------
    The Users are always right - when I'm not wrong!

  • The SQLDTS article is essentially a copy of the code in the MSDN article, with the added description of how to wrap the code in a COM object. We're not allowed to write our own COM objects.

    Neither article actually describes how to install the appropriate libraries on IIS with or without installing SQL.

    Anyone have any ideas? I'm running out of options and time.

     

  • Aplogies. Thought that explained how to install dts without sql. See this link:

     

    http://www.windowsitpro.com/SQLServer/Article/ArticleID/7444/7444.html


    ------------------------------
    The Users are always right - when I'm not wrong!

  • Thanks. That's what I need to pass along to the IIS folks.

     

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply