I am trying to retrieve data from a stored procedure in MS SQL 2000 that has had to use temporary tables in coming up with the required dataset. However, when I call the procedure from a web page in which I am using VB script to call and retrieve the data, the recordset is always closed when I try to use it.
ex.
'Establish a connection with data source.
Set cnn = Server.CreateObject("ADODB.Connection"
cnn.Open(application("DBconnNewBudgetRO")
'Instantiate a Recordset object.
Set rs = Server.CreateObject("ADODB.Recordset"
strSQL = "aTest1 '" & Session("DataYear" & "'"
rs.Open strSQL, cnn
' ANY statement that trys to use the dataset rs gets the following error
' Operation is not allowed when object is closed
DO UNTIL rs.EOF <--- crash here
Response.Write rs.Fields("FundDocument" & vbCrLf
rs.MoveNext
LOOP
rs.Close
Set rs = nothing
There MUST be a way to return data from MS SQL that used temp tables to gather and format the records... but I have had no luck at all. HELP!?!?!?
ex.
'Establish a connection with data source.
Set cnn = Server.CreateObject("ADODB.Connection"
cnn.Open(application("DBconnNewBudgetRO")
'Instantiate a Recordset object.
Set rs = Server.CreateObject("ADODB.Recordset"
strSQL = "aTest1 '" & Session("DataYear" & "'"
rs.Open strSQL, cnn
' ANY statement that trys to use the dataset rs gets the following error
' Operation is not allowed when object is closed
DO UNTIL rs.EOF <--- crash here
Response.Write rs.Fields("FundDocument" & vbCrLf
rs.MoveNext
LOOP
rs.Close
Set rs = nothing
There MUST be a way to return data from MS SQL that used temp tables to gather and format the records... but I have had no luck at all. HELP!?!?!?