Help please!!!
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
GO
My code looks like:
Dim Cmd 'Command object
Dim Connection
Set Cmd = Server.CreateObject("ADODB.Command")
Set Connection = "The connection string goes here"
Connection.Open
Set Cmd.ActiveConnection = Connection.Connection
Cmd.CommandText = "Students"
Cmd.CommandType = adCmdStoredProc
Cmd.Parameters.Refresh
set rs = Cmd.Execute
Do While Not rs.EOF
response.write(rs.Fields("FirstName") & ", " & rs.Fields("LastName") & ", " & rs.Fields("Address") )
loop
I am getting the error: ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.