Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Running DTS from ASP page
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Running DTS from ASP page

 Post Reply Post Reply Page  123 6>
Author
Gary View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 March 2002
Location: United Kingdom
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gary Quote  Post ReplyReply Direct Link To This Post Topic: Running DTS from ASP page
    Posted: 05 November 2007 at 1:11pm
Hi,
 
I am trying to run a DTS from an asp page and have had some success, but now I am struggling when it comes to data pump tasks that import data from an Excel file.
 
My environment is this:
 
Webserver
  • asp page that uploads an Excel file (using ASPUpload)
  • asp page then calls LoadFromSQLServer which executes a DTS located on the Database server
  • running with Windows Authentication
Database Server (SQL 2000)
  • DTS package that contains SQL tasks and a Data Pump task which loads data from the Excel file located on the Webserver
When I run the DTS from Ent Manager it works fine.
When I run from the asp page all SQL tasks work, but the Data Pump fails.
I have played around with the security of folder in which the Excel file is located, but to no avail.
 
When I built the code I did so in a single server environment (single machine acting as webserver and database server) and it ran just fine.
Now in a 2 server environment it fails which suggests maybe a permissions issue with accessing the data (Excel) file. But having toyed with the folder permissions I cant help but think that there is more tp it than that.
 
 
Any ideas?
 
Thanks
Gary
Back to Top
socialanimal View Drop Down
Newbie
Newbie
Avatar

Joined: 14 October 2007
Location: Leeds, UK
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote socialanimal Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2007 at 1:50pm
Here's the code I use to do the exact same thing, the code will tell you where it's failing which is obviously the first thing you need to make sure of. It does sound like it is a permissions issue, but before going any further and speculating, it's probabaly easier to find out where its failing (at which step) and go on from there.


'***************************************************************************************'
'                                            '
' Run the DTS Package                                    '
'                                            '
'***************************************************************************************'

const DTSSQLStgFlag_Default = 0

const DTSStepExecResult_Failure = 1

set objDTSPackage = CreateObject("DTS.Package")

blnSucceeded = true

objDTSPackage.LoadFromSQLServer "SQLServername", "username", "password", SQL_Server_TblName, "", "", "", "DTS_Package_Name"

objDTSPackage.Execute

for each objDTSStep in objDTSPackage.Steps

if objDTSStep.ExecutionResult = DTSStepExecResult_Failure then

strResult = strResult & "Package " & objDTSStep.Name & " failed.<br>"

blnSucceeded = false

else

strResult = strResult & "Package " & objDTSStep.Name & " succeeded.<br>"

end if

next

response.write strResult


Back to Top
Gary View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 March 2002
Location: United Kingdom
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gary Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2007 at 2:08pm
Thanks for the suggestion....
 
I have used similar code to identify the step that is failing and it is indeed the Data Pemp step from the Excel file.
Furthermore, if I remove the Data Pump step, then the package completes successfully.
 
Conclusion is that there is definitely a permissions issue.
 
Problem remains that I cannot over it.
 
IIS is running under Windows Authetication only. Connection is using a DSN on the IIS server which points to the database on the remote database server.
Now I thought that with the above, access to the source Excel file would be using my user credentials. My user definitely has access to the file.
Back to Top
ctscott View Drop Down
Senior Member
Senior Member


Joined: 27 May 2003
Location: United States
Status: Offline
Points: 246
Post Options Post Options   Thanks (0) Thanks(0)   Quote ctscott Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2007 at 2:38pm
thanks Socialanimal.  i've always figured you could do it but didn't know how or what to search for.
______________________
College Football Trivia
Back to Top
socialanimal View Drop Down
Newbie
Newbie
Avatar

Joined: 14 October 2007
Location: Leeds, UK
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote socialanimal Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2007 at 2:44pm
Originally posted by Gary Gary wrote:

Thanks for the suggestion....
 
I have used similar code to identify the step that is failing and it is indeed the Data Pemp step from the Excel file.
Furthermore, if I remove the Data Pump step, then the package completes successfully.
 
Conclusion is that there is definitely a permissions issue.
 
Problem remains that I cannot over it.
 
IIS is running under Windows Authetication only. Connection is using a DSN on the IIS server which points to the database on the remote database server.
Now I thought that with the above, access to the source Excel file would be using my user credentials. My user definitely has access to the file.


Just to bounce some questions off you so that we can try and get to the bottom of this then:

On the SQL Server, who are you logged in as ? Yourself or a built - in account (eg administrator).

On the excel file itself, do you have the inherited permissions for the entire folder ? And on the excel file you're only reading the information ?

Have you tried using anyone elses authentication when executing the DTS ? If so, did that work ?
Back to Top
socialanimal View Drop Down
Newbie
Newbie
Avatar

Joined: 14 October 2007
Location: Leeds, UK
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote socialanimal Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2007 at 2:45pm
Originally posted by ctscott ctscott wrote:

thanks Socialanimal.  i've always figured you could do it but didn't know how or what to search for.


No sweat mate. Very handy tool. Don't really have a call to execute it in ASP so much, generally run it as a scheduled task overnight.
Back to Top
Gary View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 March 2002
Location: United Kingdom
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gary Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2007 at 2:52pm
On the SQL Server, who are you logged in as ? Yourself or a built - in account (eg administrator).
The server is logged on with a domain account that is a member of the local admins group on both the web and SQL server.
 
On the excel file itself, do you have the inherited permissions for the entire folder ? And on the excel file you're only reading the information
Yes, the Excel file has the inherited perms (everyone has Full Control access)
 
And on the excel file you're only reading the information ?
Yes, all I am doing is having the Excel file as a data source and using a Data Pump task to pull the data into SQL
 
Have you tried using anyone elses authentication when executing the DTS ? If so, did that work
Yes, I even tried using the domain account that I mentioned above (the one that is a member of local admin group) and it didnt work
 


Edited by Gary - 05 November 2007 at 2:53pm
Back to Top
Gary View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 March 2002
Location: United Kingdom
Status: Offline
Points: 326
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gary Quote  Post ReplyReply Direct Link To This Post Posted: 05 November 2007 at 3:00pm
I cant help but feel that when the DTS is invoked via an asp, it is not using any windows based authentication when trying to access the Excel file.
 
The code example provided above uses a SQL User Account to run the DTS - could that be part of the problem? If so, how do I run the same but using a domain account?
Back to Top
 Post Reply Post Reply Page  123 6>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.