Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2006, 02:41 PM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default ADODB.Recordset error '800a0e78'

Hi all,

I m new to asp, to Ms-sql and this forum.

I am getting the following error while executing a asp page

"ADODB.Recordset error '800a0e78'

Operation is not allowed when the object is closed. "

I am havin a sub in asp code that call a stored procedure.. the Stored procedure return either 1 or 0. this is to be validated in the SUB. I get the error in "IF rstBandReqStatus.EOF THEN..." line.

The sub code is as follows:-

================================================== =======
Sub subCheckForPendingRequests(strRequestNo)

DIM rstBandReqStatus
DIM strSqlBandReqDetails
DIM strFlag



    SET objCommand = Session("ObjDBConnect").CreateCommand
    CALL OutputDebugFile(1, "CPSConnection")
    objCommand.ActiveConnection = Session("objConn")
       SET rstBandReqStatus = Session("ObjDBConnect").CreateRecordset

    objCommand.CommandText = "testingDB..spCPSCheckForPendingBandRetReq"
    objCommand.CommandType = adCmdStoredProc
    objCommand.Parameters.Append objCommand.CreateParameter("intRequestNumber",adIn teger, adParamInput,9, strRequestNo)

    rstBandReqStatus.Open objCommand,,adOpenStatic



    'If there is any error while executing the SP, redirect to Error page.
    IF err.number <>0 THEN
        SET rstBandReqStatus = NOTHING
        SET objCommand = NOTHING
        IF instr(1,Err.description,"CPS")>0 THEN
            Response.Redirect "CPSError.asp?ErrorCode=CPS_NOT_CURR"
        END IF
         CALL OutputDebugFile(0, "CPSConnection")
        Response.Redirect "CPSError.asp?ErrorCode=CPS_REQ_DET_SEL_FAIL&Param eters=RequestDetails~" & strRequestNo
    END IF

    IF rstBandReqStatus.EOF THEN
        SET rstBandReqStatus = NOTHING
        SET objCommand = NOTHING
         CALL OutputDebugFile(0, "CPSConnection")
         Response.Redirect "CPSError.asp?ErrorCode=CPS_NO_REQ_DET&Prameters=R equestDetails~" & strRequestNo
    END IF

    strFlag = rstBandReqStatus("@intFlag")

    rstBandReqStatus.Close
    SET rstBandReqStatus = NOTHING
    SET objCommand = NOTHING
    CALL OutputDebugFile(0, "CPSConnection")

    if strFlag<>0 then
        Response.Redirect "CPSError.asp?ErrorCode=CPS_SURRENDER_REQUEST_EXIS TS"
    ELSE
        CALL subGetBandRequestDetails(strRequestNo)
    END IF

End Sub
-----------------------------------
--------------------------------

The stored procedure is as follows



CREATE procedure alphaone.spCPSCheckForPendingbandRetReq
(@intRequestNumber int)
AS
SET NOCOUNT ON

DECLARE @intFlag int --is 1 if the requests or activeband connection exists
DECLARE @txtEmpNo varchar(25)
--DECLARE @txtReturnReqStatus varchar(25)

SET @intFlag=0 --By default there is no pending surrender request

/* Getting the employeeID for the request using the request-number */
SELECT @txtEmpNo= a.txtEmpNo FROM TestingDB.alphaone.CPSTrnbandRequest a WITH (NOLOCK) ,
        TestingDB.alphaone.CPSTrnbandRequest b WITH (NOLOCK)
WHERE a.txtEmpno=b.txtEmpno
AND a.intReqNo = @intRequestNumber



/* Checking if active connection already exists or return-request on active connection */
If exists (SELECT 1 from TestingDB.alphaone.CPSTrnbandRequest WITH (NOLOCK)
WHERE txtEmpno=@txtEmpno and txtNewReqStatus = 'D' and (txtRetReqStatus = 'A' OR txtRetReqStatus='C'))
BEGIN
SET @intFlag=1
END

Else
/* In case on non-existence of active connection already exists or return-request on active connection */
BEGIN
SET @intFlag=0
END


/* Pass the @intFlag value to the webpage */
BEGIN
return @intFlag

END
GO
==================================================


Please help me:(
 
Old March 24th, 2006, 05:04 PM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think I know what the problem is, but don't know how to solve it. It looks the asp page refuses to take @intFlag from the storeprocedure. I don't know what changes i have to do to for this. I tried changin from return @intflag to select @intFlag, even that is not accepted.
After some changes in Asp, i get the following error "Item cannot be found in the collection corresponding to the requested name or ordinal. "

I tried changing the Stored procedure to
CREATE procedure misuser.spCPSCheckForPendingBroadbandRetReq
(@intRequestNumber int, @intFlag int OUTPUT)
That doesn't solve it either...

Wonder what is wrong?

 
Old March 27th, 2006, 10:05 AM
Registered User
 
Join Date: Mar 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i found the solution.

instead of sending the variable as select @intFlag

i use select @intFlag as strflag as output value.:D






Similar Threads
Thread Thread Starter Forum Replies Last Post
ADODB.Recordset error 800a0e78 quinnie Classic ASP Databases 6 October 2nd, 2007 05:13 PM
ADODB.Recordset error lance Wrox Book Feedback 2 February 23rd, 2007 02:37 PM
ADODB.RecordSet -- Error nabeeljohn Classic ASP Professional 10 November 9th, 2006 05:23 AM
ADODB.Recordset error '800a0e78' nancy Classic ASP Databases 6 September 1st, 2004 09:42 AM
ADODB.Recordset error '800a0cc1'Item cannot be.... ashu_gupta75 Classic ASP Databases 1 March 5th, 2004 03:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.