Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Running an SQL Server DTS from an ASP

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-05-28 : 23:47:35
Paul writes "The question is how to set up the IIS/Personal Web server to run a SQL Server DTS from ASP?

I have example code from Microsoft Support that shows how to set up the ASP code using the DTS.Package object.

I have tried many different configurations of authority with the IIS and the DTS package, but only with a certain degree of success and never getting the DTS steps to complete successfully.

After trial and error, I found the only way to get the DTS to attempt to run was to set the IIS Directory Security Authenticated Access to Basic Authentication (sending the passwords in the clear). After doing so, the ASP was able to execute the DTS package, but the steps fail. Can you help???

I can put the same code into VB and it works great! I just can't seem to pull it off with ASP. I am running SQL Server 7.0 from Windows 2000. The SQL Server is running on an NT Server 4.0 machine.

Please let me know what you think! Thank you so much for any time spent. I most definitely appreciate it. Paul

If you require any other examples, or the DTS, or anything else please do not hesitate to ask. It doesn't seem to matter what the DTS does...

Here is my example code:

R09800 DTS Import


Response.Addheader "WWW-Authenticate", "BASIC"
Const DTSSQLStgFlag_Default = 0
Const DTSStepExecResult_Failure = 1
const DTSSQLStgFlag_UseTrustedConnection = 256

Dim oPkg
Dim oStep, sMessage, bStatus

Set oPkg = Server.CreateObject("DTS.Package")

'oPkg.LoadFromSQLServer "WALCO_SQL","sa","sauser",DTSSQLStgFlag_Default,"","","","R0
9800IMPORT"
oPkg.LoadFromSQLServer "WALCO_SQL","","",DTSSQLStgFlag_UseTrustedConnection,"","","
","R09800IMPORT"
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
"
bStatus = False
Else
sMessage = sMessage & " succeeded
"
End If
sMessage = sMessage & "Task """ & oPkg.Tasks(oStep.TaskName).Description & """</P>"
Next

If bStatus Then
sMessage = sMessage & "<P>Package [" & oPkg.Name & "] succeeded</P>"
Else
sMessage = sMessage & "<P>Package [" & oPkg.Name & "] failed</P>"
End If

Response.Write sMessage
Response.Write "<P>Done</P>"


"
   

- Advertisement -