p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_databases thread: Re: Error:Operation is not allowed when the object is closed


Message #1 by kev_web25@b... on Thu, 13 Jun 2002 11:54:08
Hi

Just one thing, do you not need to Execute the command before opening the 
recordset object?

After specifying the .ActiveConnection property try putting 
cmdResult.Execute. Not guaranteed to work, because i don't know what the 
rest of the code is, but it might.

Kev
Message #2 by "Catherine Michel" <cmichel101@h...> on Tue, 4 Jun 2002 15:44:07
Hi!
I have a command object and the command type is a stored procedure. The 
stored procedure is a select statement.  I want to view 5 result per page 
This is some of my code:

Set cmdResult = Server.CreateObject("ADODB.Command")
cmdResult.CommandType = adCmdStoredProc 
cmdResult.CommandText = "sp_Practitioner13"
cmdResult.ActiveConnection = cnToronto

Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.CursorType = 3
rs.Open = cmdResult

if rs.EOF then  <- The error occurs at this line
...

I have this error message:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.

Any help would be very appreciated!
Thanks
Catherine

  Return to Index