I am trying to do just that, return a record set in a stored proc and loop throgh in VB
My stored proc looks like:
CREATE PROCEDURE [dbo].[Students] AS
Select FirstName, LastName, Address From Studetns Order By Name
My code looks like:
Dim Cmd 'Command object
Set Cmd = Server.CreateObject("ADODB.Command")
Set Connection = "The connection string goes here"
Set Cmd.ActiveConnection = Connection.Connection
Cmd.CommandText = "Students"
Cmd.CommandType = adCmdStoredProc
set rs = Cmd.Execute
Do While Not rs.EOF
response.write(rs.Fields("FirstName") & ", " & rs.Fields("LastName") & ", " & rs.Fields("Address") )
I am getting the error: ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.