Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: ADODB.Recordset(0X800A0E78) ---HELP!!!


Message #1 by "Salman Ahmed" <salman.ahmed@r...> on Thu, 16 Aug 2001 15:19:28
I am getting the following error while trying to read a recordset:



ADODB.Recordset(0X800A0E78)Operation is not allowed when the object is

closed.



The error happens in the following line after I execute a stored

procedure in SQLSERVER 7:



    Set DataConn = Server.CreateObject("ADODB.Connection")



    DataConn.Open "DSN=LapDomA;uid=Brain;pwd=Brain"



    SET AdoCmd = Server.CreateObject("ADODB.Command")



    SET AdoCmd.ActiveConnection = DataConn



    AdoCmd.CommandType = adCmdStoredProc



    AdoCmd.CommandText = "sp_Logon"



    AdoCmd.Parameters.Append AdoCmd.CreateParameter

("Return",adInteger,adParamReturnValue,4)



    AdoCmd.Parameters.Append AdoCmd.CreateParameter("User

name",adVarChar,adParmInput,50,Request.Form("User Name"))

                     AdoCmd.Parameters.Append AdoCmd.CreateParameter

("Password",adVarChar,adParmInput,50,Request.Form("Password"))



    Set rs = AdoCmd.Execute



While not rs.EOF   <----- Line of error!!!!!!!!!!!



   do something.........



Wend



I do not know how to debug this problem.

Please help!!!!

Salman





Message #2 by <wburrough67@y...> on Thu, 16 Aug 2001 17:29:43 +0100
I know I've had this but can't remember what fixed it. Try putting SET NOCOUNT

ON at the top of your sproc. It seems to solve lots of wierd things.

Walter



> -----Original Message-----

> From: Salman Ahmed [mailto:salman.ahmed@r...]

> Sent: 16 August 2001 15:19

> To: ASP Databases

> Subject: [asp_databases] ADODB.Recordset(0X800A0E78) ---HELP!!!

>

>

> I am getting the following error while trying to read a recordset:

>

> ADODB.Recordset(0X800A0E78)Operation is not allowed when the object is

> closed.

>

> The error happens in the following line after I execute a stored

> procedure in SQLSERVER 7:

>

>     Set DataConn = Server.CreateObject("ADODB.Connection")

>

>     DataConn.Open "DSN=LapDomA;uid=Brain;pwd=Brain"

>

>     SET AdoCmd = Server.CreateObject("ADODB.Command")

>

>     SET AdoCmd.ActiveConnection = DataConn

>

>     AdoCmd.CommandType = adCmdStoredProc

>

>     AdoCmd.CommandText = "sp_Logon"

>

>     AdoCmd.Parameters.Append AdoCmd.CreateParameter

> ("Return",adInteger,adParamReturnValue,4)

>

>     AdoCmd.Parameters.Append AdoCmd.CreateParameter("User

> name",adVarChar,adParmInput,50,Request.Form("User Name"))

>                      AdoCmd.Parameters.Append AdoCmd.CreateParameter

> ("Password",adVarChar,adParmInput,50,Request.Form("Password"))

>

>     Set rs = AdoCmd.Execute

>

> While not rs.EOF   <----- Line of error!!!!!!!!!!!

>

>    do something.........

>

> Wend

>

> I do not know how to debug this problem.

> Please help!!!!

> Salman

Message #3 by Steve Carter <Steve.Carter@t...> on Fri, 17 Aug 2001 10:45:43 +0100
does sp_Logon return rows?  If not, then change 



 Set rs = AdoCmd.Execute



to



 AdoCmd.Execute



and delete



 While not rs.EOF   <----- Line of error!!!!!!!!!!!



    do something.........



 Wend



HTH



Steve.



> > I am getting the following error while trying to read a recordset:

> >

> > ADODB.Recordset(0X800A0E78)Operation is not allowed when 

> the object is

> > closed.

> >

> > The error happens in the following line after I execute a stored

> > procedure in SQLSERVER 7:

> >

> >     Set DataConn = Server.CreateObject("ADODB.Connection")

> >

> >     DataConn.Open "DSN=LapDomA;uid=Brain;pwd=Brain"

> >

> >     SET AdoCmd = Server.CreateObject("ADODB.Command")

> >

> >     SET AdoCmd.ActiveConnection = DataConn

> >

> >     AdoCmd.CommandType = adCmdStoredProc

> >

> >     AdoCmd.CommandText = "sp_Logon"

> >

> >     AdoCmd.Parameters.Append AdoCmd.CreateParameter

> > ("Return",adInteger,adParamReturnValue,4)

> >

> >     AdoCmd.Parameters.Append AdoCmd.CreateParameter("User

> > name",adVarChar,adParmInput,50,Request.Form("User Name"))

> >                      AdoCmd.Parameters.Append AdoCmd.CreateParameter

> > ("Password",adVarChar,adParmInput,50,Request.Form("Password"))

> >

> >     Set rs = AdoCmd.Execute

> >

> > While not rs.EOF   <----- Line of error!!!!!!!!!!!

> >

> >    do something.........

> >

> > Wend

Message #4 by "Ken Schaefer" <ken@a...> on Mon, 20 Aug 2001 12:20:58 +1000
You have to check to make sure that you have results *first*!



If not objRS.EOF then



    Do While Not objRS.EOF



    Loop



Else



    ' WE HAVE NO RECORDS

    ' We can't manipulate the recordset



End If



Cheers

Ken



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

----- Original Message -----

From: "Salman Ahmed" <salman.ahmed@r...>

To: "ASP Databases" <asp_databases@p...>

Sent: Thursday, August 16, 2001 3:19 PM

Subject: [asp_databases] ADODB.Recordset(0X800A0E78) ---HELP!!!





: I am getting the following error while trying to read a recordset:

:

: ADODB.Recordset(0X800A0E78)Operation is not allowed when the object is

: closed.

:

: The error happens in the following line after I execute a stored

: procedure in SQLSERVER 7:

:

:     Set DataConn = Server.CreateObject("ADODB.Connection")

:

:     DataConn.Open "DSN=LapDomA;uid=Brain;pwd=Brain"

:

:     SET AdoCmd = Server.CreateObject("ADODB.Command")

:

:     SET AdoCmd.ActiveConnection = DataConn

:

:     AdoCmd.CommandType = adCmdStoredProc

:

:     AdoCmd.CommandText = "sp_Logon"

:

:     AdoCmd.Parameters.Append AdoCmd.CreateParameter

: ("Return",adInteger,adParamReturnValue,4)

:

:     AdoCmd.Parameters.Append AdoCmd.CreateParameter("User

: name",adVarChar,adParmInput,50,Request.Form("User Name"))

:                      AdoCmd.Parameters.Append AdoCmd.CreateParameter

: ("Password",adVarChar,adParmInput,50,Request.Form("Password"))

:

:     Set rs = AdoCmd.Execute

:

: While not rs.EOF   <----- Line of error!!!!!!!!!!!

:

:    do something.........

:

: Wend

:

: I do not know how to debug this problem.

: Please help!!!!

: Salman

:

:

:

: ---

: * Fast, Full-Featured Microsoft® Excel Web Reports & Charts!

: A breakthrough in high performance Web application development,

SoftArtisans

: ExcelWriter 1.1 supports native Excel charting, image insertion, and

: advanced functions & formatting. One click generates presentation-quality

: Excel spreadsheets-and ExcelWriter performs over 100 times faster than the

: Excel Object. Several editions, including ExcelWriterFREE, are available.

: http://www.softartisans.com/softartisans/excelwriter.html>




$subst('Email.Unsub')



Message #5 by "Patrick Sullivan" <psullivan@m...> on Tue, 21 Aug 2001 17:45:56
> I know I've had this but can't remember what fixed it. Try putting SET 

NOCOUNT

> ON at the top of your sproc. It seems to solve lots of wierd things.

> Walter

> 



You also may want to turn the NOCOUNT Back on at the end of the sproc. 



The sproc is returning two recordsets, the one you want and a system 

recordset, which is basically (x rows effected) or something of that 

nature. You could also use a NextRecordset in the asp page, but it is much 

easier to have the NOCOUNT within the SPROC. 

  Return to Index