Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTS Package fail from ASP 1

Status
Not open for further replies.

nightjam

Programmer
May 14, 2004
18
JM
I have created a DTS package to
1. Execute a SQL task - which deletes all old data from a SQL database table

2. Import data from CSV file to SQL database Table.

Now the DTS package runs Ok and fine from enterprise manager but when I run it from ASP it fails at item/step 2.

ASP uses server authentication to access database and run DTS package which has owner/system administration privelliges and also access to the CSV files folder.

I also gave IUSER access to database and folders.

Any other troubleshootign help?

ASP code is as follows:
function runDTS(DeptName, DTSType)

Const DTSSQLStgFlag_Default = 0
Const DTSStepExecResult_Failure = 1

Dim oPkg, oStep, sMessage, bStatus

Set oPkg = Server.CreateObject("DTS.Package")
'Load Employee Data
oPkg.LoadFromSQLServer "ServerName","sa","password",DTSSQLStgFlag_Default,"","","", "PackageName_"& DeptName & DTSType
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

oPKG.UnInitialize
Set oStep = Nothing
Set oPKG = Nothing

'response.write("Status: " &bStatus)
'reponse.end()

if bStatus = False then
response.redirect "dtstest.asp?Results=UnkError&Description=" & sMessage
end if

end function
 
it sounds like you are on the right track looking at the permissions... perhaps splitting these two tasks into two separate DTS packages will help with make debugging easier.
 
I resolved problem. On IIS server I had to enable read permission for Scripting from web based application for the folder that contained the CSV files.
 
Thanks for posting the follow-up so that others with the same issue may benefit from your solution.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top