Solved

Running DTS Package with ASP

Posted on 2001-06-19
11
328 Views
Last Modified: 2013-11-30
Hello,
I'm trying to run a DTS package through an ASP page but having trouble getting the package to run. Here is the type of connection I'm using to run the package. I can run
the package in Enterprise manager fine but cannot execute it through the web. I created the DTS package with the SA account on the server using SQL authentication. I'm using UNC linking for all the links in the DTS package as well. I still believe that it's a security problem between the webserver and sql server. I'm not sure if I need to edit hte permissions on the IUSR_Webserver account or need to setup the package using windows NT authentication and using a trusted connection in the package. But I'm not too sure on how to set that up.
Here is the error that I'm getting

Create Table SCLevels_summary Step failed.
Copy Data from SCLevels_summary to SCLevels_summary Step failed.

and below is the code I'm using to run the package. Any help would be greatly appreciated.


 Dim objPkg, strError, iCount

  'Create and Execute the package
  Set objPkg = Server.CreateObject("DTS.Package")
  objPkg.LoadFromSQLServer "SQLServer", "username", "password", _
    DTSSQLStgFlag,"","","","DTS_SCLevelstest2"
  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
0
Comment
Question by:KevinKFLA
  • 5
  • 4
  • 2
11 Comments
 
LVL 5

Expert Comment

by:gbaren
ID: 6207277
To resolve security issues, create a local user on the database server with the exact same name and password as the one who's running the DTS package from the web server.

In other words, if an anonymous user on the Webserver is running it, and the user name is IUSR_Webserver, then create IUSR_Webserver on the database server locally. Assign the necessary permissions to the local user.

This is the LanServer security holdover. Local users on separate machines with the same name and password are considered the same.

I had very much the same issues with OLAP accross domains and this method worked out.
0
 
LVL 15

Expert Comment

by:robbert
ID: 6207608
gbaren is right.

Alternatives are a) putting DTS.Package to an Component Services / MTS package and running it as "this" user, and b) executing the DTS package by an ADODB.Command object (that would allow to run under the sa account).
Let me know which way you want to go.
0
 

Author Comment

by:KevinKFLA
ID: 6207837
I'm in the process of trying your suggestion, At the moment the sql server is down while our IT's add a new drive. I just want to make sure I do the right thing. I need to create a local account on the SQL box with the same permissions/Username/pass to match the one on the Server box (the iusr_account that the webserver uses)? or just make one that matches the username an password that I'm calling in my code above? Also I'm not sure if this is the easiest and best method. All this Package is doing is running an export to an excel spreadsheet for users to download.
0
 
LVL 15

Expert Comment

by:robbert
ID: 6207901
SQL Server 2k -- then, there's probably another solution.
0
 

Author Comment

by:KevinKFLA
ID: 6211373
I created an account on the SQL box with the same username and password I'm using to run the package and that did not work for me it's still erroring out with the same message as above. I'm not sure what to try next.

0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 5

Expert Comment

by:gbaren
ID: 6211410
Did you create a SQL Server account with the new userid?

Did you assign permissions for that account to run the DTS job?

What is the userid of the account you created on the SQL box?

What is the error message you are seeing?

*** ON ANOTHER TRACK: ***

What user id is the SQLSERVERAGENT using to log on?

If it is using the LocalSystem account, try changing it to a Domain Administrator account.
0
 

Author Comment

by:KevinKFLA
ID: 6211532
I created a local user on the SQL box to match that of the IUSR_webserver account and also created a new sql user with the same username on enterprise manager that can execute the DTS package.

The error message I get from my ASP code is as follows

Create Table SCLEVELS Step failed. Copy Data from SCLEVELS to SCLEVELS Step failed.

What user id is the SQLSERVERAGENT using to log on?
Not sure ???

0
 
LVL 5

Accepted Solution

by:
gbaren earned 200 total points
ID: 6211556
Go into your services (right-click manage on My Computer in W2K or in control panel in NT) and check the logon information for the SQLSERVERAGENT service. I believe that is the service that runs DTS jobs.

I'm not sure whether the SQL Server Agent or current user runs DTS jobs. I'm leaning toward the Agent.
0
 

Author Comment

by:KevinKFLA
ID: 6211687
that service is using the localsystem account and when I try to change it to the domain admin or any other user for that matter I get the following error message

Cannot set the startup parameters for the SQLServeragent, service ERROR 1057 occurried the account name is invalid

I've been researching other ways of trying to complete this task do you know if it is would be easier to run this as a job in SQL Server? Can that be done by calling an object with asp?
0
 

Author Comment

by:KevinKFLA
ID: 6215573
I figured it out using the Job option in SQL Server then calling that with asp. Thanks for the help though.
0
 
LVL 5

Expert Comment

by:gbaren
ID: 6215627
I'm glad you got it running. Invalid account, btw, is probably because you need to use DOMAIN\USERID format for the USERID.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now