Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Running DTS Package with ASP

Posted on 2001-06-19
11
Medium Priority
?
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 
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
 
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 800 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

721 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