Error on executing DSP package via ASP -
09-10-2003
, 05:18 PM
Hi,
I am trying to execute a DTS package, that clears the contents of a
table t_test, from ASP. The code looks as follows:
'-----------------------------------------------------------------------
--------------
dim objDTSPackage
dim objDTSStep
dim strResult
dim blnSucceeded
const DTSSQLStgFlag_Default = 0
const DTSStepExecResult_Failure = 1
set objDTSPackage = Server.CreateObject("DTS.Package")
blnSucceeded = true
vPackage = "TestPackage2"
objDTSPackage.LoadFromSQLServer "dev", "sa", "password",
DTSSQLStgFlag_Default, "", "", "", vPackage
objDTSPackage.Execute
for each objDTSStep in objDTSPackage.Steps
if objDTSStep.ExecutionResult = DTSStepExecResult_Failure then
strResult = strResult & "Step " & objDTSStep.Name & "
failed.<br><br>"
blnSucceeded = false
else
strResult = strResult & "Step " & objDTSStep.Name & "
succeeded.<br><br>"
end if
next
if blnSucceeded then
vResult = "<h1>Package Succeeded</h1>"
else
vResult = "<h1>Package Failed</h1>"
end if
Set objDTSPackage = Nothing
'-----------------------------------------------------------------------
--------------
This on execution gives the following error:
"Step DTSStep_DTSExecuteSQLTask_1 failed"
The package works fine and does the required task when executed
manually.
I guess the error is due to a permission problem. But both IIS and SQL
are on the same server.
Can anyone point out what I could be missing?
Thanks a bunch in advance
Sri
--
Posted via http://dbforums.com |