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)
 Stored Proc executes but doesn't do anything

Author  Topic 

joelbrda
Starting Member

5 Posts

Posted - 2005-03-25 : 15:38:38
I have a stored procedure that works fine if I run it in through query analyzer. However, when I call it from asp it runs (shows up in profiler as executed) but it doesn't do my update. I know it's not a problem with the procedure, but instead how I'm calling from ASP. Any ideas!!?!

' connProc.Open DatabaseConnection
' Dim cmd, rs2
' Set cmd = Server.CreateObject("ADODB.Command")
' With cmd
' .ActiveConnection = connProc
' .CommandType = 4
' .CommandText = "sumANDcount"
' .Parameters.Append .CreateParameter("@uid", 3, 1, 1, 50)
' .Execute
' End With

SamC
White Water Yakist

3467 Posts

Posted - 2005-03-26 : 09:15:50
What owner are you using in QA and ASP, what error(s) are returned to ASP...

Google for ASP error handling code. Here's the simple stuff

Response.Write vbCrLf & "<!-- Error: (" & Err.Number & ") " & Err.Description & " -->"
Go to Top of Page

joelbrda
Starting Member

5 Posts

Posted - 2005-03-26 : 16:33:02
For asp I'm using a DSN and it's connected to SQL with windows authentication...same for QA. And I have rights to the SP with windows authentication user. So I don't think it's a user problem...and if it was I would think it would give me an error?

There aren't any errors returned...everything runs like it worked fine. However, in QA when I call the SP it takes like 5 mins to run, but from the ASP page it just takes a sec and that's it. So the SP shows as executed but I don't think any of the code ever runs.

Thanks in advance...
Go to Top of Page

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2005-03-27 : 07:24:55
What a strange love for Command object! I'd prefer:

Set rs = cn.Execute("exec myDB..mySproc ..., ..., ...")
or
cn.Execute "exec myDB..mySproc ..., ..., ..."
Go to Top of Page
   

- Advertisement -