How do you get a DTS setup in ASP

  • Is there anyway of getting a SQL server generated VB Module DTS into ASP.If so how?

  • If you mean execute a VB DTS package from an ASP page then you could compile the VB DTS package as a dll, and then reference and execute it from your asp page. I haven't done this for a DTS package but I can't see any reason why this wouldn't work.

    This would probably be quicker, especially if you need to run a few packages, than rewriting the code in VBS style (e.g. CreateObject("x.y") etc. ).

    Also could you not compile the DTS package as an exe and just shell it form ASP?

    If you need to run loads of packages that may change, you might consider making a DLL as an interface which can launch other DTS packages based on parameters. That way you can change your DTS packages without having to rebuild your basic component (which also requires restarting IIS).

    If you are unfamiliar with making COM components from VB then there are millions of articles on this very topic all over the web of which the below is just one example:

    http://www.avdf.com/apr98/art_id003.html

  • Cheers

  • And...How do we perform the vice versa?.i.e. from ASP to SQL?

  • You might look up Microsoft Knowledge Base Article - 252987. It is titled "INF: Execute a SQL Server DTS Package from Active Server Pages"

  • Use the DMO Object in ASP Page .It is allow you to do programmatically everything you do using Enterprise manager. For example you can create DTS package ,then create SQL Agent job from this package and execute this job from the ASP page or wrap this logic to the Function format.

    Example:

    Function StartJob(sServer,sUser,sPSW,sJobName, byref sErrRtn)

    Dim objServer 'As SQLDMO.SQLServer

    on error resume next

    Set objServer = Server.CreateObject("SQLDMO.SQLServer")

    objServer.Connect sServer, sUser, sPSW

    objServer.JobServer.Jobs(cstr(sJobName)).Refresh

    objServer.JobServer.Jobs(cstr(sJobName)).Start

    objServer.DisConnect

    objServer.Close

    Set objServer = Nothing

    if err.number = 0 then

    StartJob = true

    else

    sErrRtn = err.Description

    StartJob = false

    end if

    End function

    Stan


    Stan

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

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