I have a web application written in asp 6.0, my problem is that I execute a sql server store procedure and I get an empty recordset, while executing the same sp on query anlyzer I can see 5 records.
Basically the sp create a temp table, populate it, and lastly selects the results from the temp table.
I read on a preceding post to insert the clause: "SET NOCOUNT ON" to avoid getting closed recordset of the insert statements, so I did it.
The query analyzer results changed, (I didn't see the number of rows created any more) But it didn't change the result on the asp page: I still get an empty recordset.
the snippet asp code is the following:
Expand|Select|Wrap|Line Numbers
- dim cmd
- dim rs
- set cmd = server.createobject("adodb.command")
- set rs = server.CreateObject("adodb.recordset")
- cmd.commandtext = "mywonderfulstoreprocedure"
- cmd.commandtype = adcmdstoredproc
- cmd.activeconnection = cnapp 'assume that's a succesful connection
- cmd.Parameters("@month") = 3
- cmd.Parameters("@year") = 2007
- rs.open cmd
- if rs.EOF then
- Response.Write "recordset empty"
- else
- Response.Write "recordset full of stuff"
- end if
Thank you for your help in advance,
Gianni