DTSRun from asp call

Results 1 to 2 of 2

Thread: DTSRun from asp call

  1. #1
    Join Date
    Dec 1969

    Default DTSRun from asp call

    Can I use ASP to run a DTSRun package? Dont need to return anything, jsut run the package from ASP!

  2. #2
    Join Date
    Dec 1969

    Default RE: DTSRun from asp call

    Hm<BR><BR>You can, I have seen the code, I just have no idea where<BR>... found it<BR>sorry about the code dump, search the msdn library.<BR>but here is the doc.<BR><BR><BR>To execute a DTS package from ASP code, create an instance of a DTS package object and call its LoadFromSQLServer method, for example:<BR><BR><BR><BR><BR>&#060;%@Language=VBScr ipt %&#062;<BR>&#060;HTML&#062;<BR>&#060;HEAD&#062;<BR >&#060;META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"&#062;<BR>&#060;/HEAD&#062;<BR>&#060;BODY&#062;<BR>&#060;%<BR> Const DTSReposFlag_Default = 0<BR> Const DTSReposFlag_UseTrustedConnection = 256<BR> Dim oPackage, strResult<BR> Set oPackage = Server.CreateObject("DTS.Package")<BR> oPackage.LoadFromSQLServer "MyServer","MyUser","MyPassword",DTSReposFlag_UseT rustedConnection,"","","","MyPackage"<BR> oPackage.Execute()<BR> Response.Write "Executing package...<BR>"<BR> For i = 1 To oPackage.Steps.Count<BR> If oPackage.Steps(i).ExecutionResult = DTSStepExecResult_Failure Then<BR> oPackage.Steps(i).GetExecutionErrorInfo (lpErrorCode)<BR> iStatus = False<BR> strErr = oPackage.Steps(i).Name + " in the " + oPackage.Description + " failed.<BR>"<BR> End If<BR> Response.Write strResult<BR> Next<BR> If iStatus = True Then<BR> strResult = oPackage.Description + " Successful<BR>"<BR> Response.Write strResult<BR> End If<BR> Response.Write "Done.<BR>"<BR>%&#062;<BR>&#060;/BODY&#062;<BR>&#060;/HTML&#062; <BR>Using the Integrated Windows NT Authentication:<BR>Use the integrated Windows NT authentication feature in SQL Server to access the DTS package. To do this, perform the following steps:<BR><BR><BR>Configure the computer running Microsoft Internet Information Server (IIS) to use Windows NT authentication.<BR><BR><BR>Configure the computer running SQL Server to allow access to all users and/or groups who need to use the package.<BR><BR><BR>Modify the LoadFromSQLServer method call to use trusted connections, as shown in the following code: <BR><BR><BR>const DTSReposFlag_UseTrustedConnection = 256<BR>oPackage.LoadFromSQLServer "MyServer","","",DTSReposFlag_UseTrustedConnection ,"","","","MyPackage" <BR><BR><BR><BR>Using DTS Events:<BR>It is not possible to use the events of the DTS package object in the ASP code because non-compiled ASP code does not support events. If you need to use the DTS events, create a compiled ASP component in Visual Basic or Visual C++, and then invoke the object from an ASP page. The DLL can then be called from the ASP script.<BR><BR>

Posting Permissions

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