View Single Post
 
Old July 15th, 2004, 06:08 PM
mdianep2p mdianep2p is offline
Registered User
 
Join Date: Jul 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default execute a package from ASP

Hi, every one!

I am a beginner for SQL server and starting to learn DTS. I copied one program as following and tried to run it, it gives me error message as "Server object error 'ASP 0178 : 80070005'

Server.CreateObject Access Error

The call to Server.CreateObject failed while checking permissions. Access is denied to this object. "

what can I do to fix it? Thanks a lot for advice.


<html>
<head>
<title>Sales Report DTS Package</title>
</head>
<body bgcolor="#FFFFFF">
<%

dim objDTSPackage
dim objDTSStep
dim strResult
dim blnSucceeded

const DTSSQLStgFlag_Default = 0
const DTSStepExecResult_Failure = 1

set objDTSPackage = server.createobject("DTS.Package")
blnSucceeded = true

objDTSPackage.LoadFromSQLServer"(local)", "sa", "", DTSSQLStgFlag_Default, "", "", "", "SalesPkg"
objDTSPackage.GlobalVariables("gPaymentTerm").Valu e = "Net 30"
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

if blnSucceeded then
Response.Write "<h1>Package Succeeded</h1>"
else
Response.Write "<h1>Package failed</h1>"
end if

Response.Write strResult

%>
</body>
</html>