Run DTS from ASP

  • Hi!

    I try to run a DTS from an simple ASP page. The package is just a simple test, and it works fine from Enterprise Manager. But not from ASP.

    Im using NT authentication and I've given the IUSR administrator rights in this testing environment (all possible rights) just to test thats not an security issue, but maybe it is? I've checked out all forums i could find but none seemed to solve this. Thanks in advance!

    I get the following error:

    Step [DTSStep_DTSDataPumpTask_1] failed

    Task "testing"

    Package [testpackage] failed

    Here is the source code:

    <%

     Const DTSSQLStgFlag_Default = 0

     Const DTSStepExecResult_Failure = 1

     Dim oPkg, oStep, sMessage, bStatus

     Set oPkg = Server.CreateObject("DTS.Package")

      oPkg.LoadFromSQLServer "(local)","","",256,"","{43CA3427-4958-4A75-B648-8288106D5A55}","{6643E36D-D9BC-42D7-93B7-2FCE0173F875}","testing"

      oPkg.Execute()

     bStatus = True

     For Each oStep In oPkg.Steps

      sMessage = sMessage & "<p> Step [" & oStep.Name & "] "

      If oStep.ExecutionResult = DTSStepExecResult_Failure Then

       sMessage = sMessage & " failed<br>"

       bStatus = False

      Else

       sMessage = sMessage & " succeeded<br>"

      End If

      sMessage = sMessage & "Task """ & oPkg.Tasks(oStep.TaskName).Description & """</p>"

     Next

     If bStatus Then

      sMessage = sMessage & "<p>Package [" & oPkg.Name & "] succeeded</p>"

     Else

      sMessage = sMessage & "<p>Package [" & oPkg.Name & "] failed</p>"

     End If

     Response.Write sMessage

     Response.Write "<p>Done</p>"

    %>

  • Oh and by the way, I don't want to use XP_CMDSHELL (the dtsrun command) - that works fine, but I want to have more realtime control of the output, speed is not an issue.

  • Why can't you just fire the job from a sp on the server??

  • Because I want to be able to handle the steps and data in realtime, I'f i'd been using SP i would just get the results - when using the DTS.Package component I can view the step - by - step and get a more nicer graphical output.

  • I don't know how to do that.. good luck with that project.

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

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