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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help for SQL (or DTS) problem?

Status
Not open for further replies.

jameslx

Programmer
Oct 18, 2001
21
US
Here's the problem. I have a web page in .asp that has to run a stored proc on the server which kicks off a dts package. The .asp page runs the query with a parameter. When it runs from the web page the query works but when it runs the dts package the package fails. If I run the stored proc from Query analyzer the stored proc works and the dts package works. The statement in the dts package that fails when the web runs the proc that runs the dts package and when the quary analyzer does the same thing is - rst.Open rcmd, , 3

'**CODE**
If Protyp = 1 Then
SQLSTMT = "SELECT RequestID, ReportID,ExportFormat, ExportDestination, ExportFileName,RDate,RTime,RunHowOften, UserRequesting,RptDateTimeStamp,LastRun,SpecialHold From tblRequest where RequestID = " & ReqID & ""
Set rcmd = createobject("ADODB.Command")
rcmd.ActiveConnection = ConnStr
rcmd.CommandType = 1 'adCmdText
Set rst = createobject("ADODB.Recordset")
rcmd.CommandText = SQLSTMT
rcmd.CommandType =1
rst.CursorLocation = 3
rst.CursorType = 3
rst.Open rcmd, , 3
If Not rst.EOF Then
...... etc.
Why would the code work through Query Analyzer but not through the web.
Does any body out there know of some change to code in a dts package that has to be different for a web running it than for Query Analyzer running it.
RequestID is an integer.
any sugestions would be welcome. It is one piece a way from running this process.
Thanks a head of time
 
This may be a long shot, but check your connection string for the security context. It may not have rights to run the package on the server its executing on.
 
mkal:
Thanks. I have been working on this problem all morning and you were on the right track. It looks like a rights issue, but not with the stored proc or the DTS package, but instead a rights issue with the web page and the location of the directory of the actual program (a Crystal Report) The web pages are on one server the DTS on another and the Crystal reports on a third server. Rights issues can become a nightmare when you have restrictions on directories and who can use them. What seems to be odd though is the fact that we can write but not read the table. Any ways thanks and we are now dealing with rights issues to clear everthing up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top