Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
| Search | Today's Posts | Mark Forums Read
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 June 11th, 2013, 09:53 AM
Registered User
Points: 43, Level: 1
Points: 43, Level: 1 Points: 43, Level: 1 Points: 43, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2012
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Operation is not allowed when the object is closed.

Can some one please let me know why I am receiving this error

Here is asp code:

Dim ObjRS
Set objConn = Server.CreateObject("ADODB.Connection")
Set ObjRS = Server.CreateObject("ADODB.Recordset")
Set Objcmd = Server.CreateObject("ADODB.Command")
objConn.Open "Provider=SQLOLEDB;User ID=eLearning; password=admin00;Data Source=QTOMASQL7SQL1.ad.qintra.com,7115;Initial Catalog=NTDElearning"
Set Objcmd.ActiveConnection = objConn
Objcmd.CommandText = "GAME_Sp_LeaderBoard"
Objcmd.CommandType = adCmdStoredProc
Objcmd.Parameters.Append Objcmd.CreateParameter("@userCuid", adVarchar, adParamInput, 10, "rkgauta")
Objcmd.Parameters.Append Objcmd.CreateParameter("@gameId", adInteger, adParamInput, 4, 4)

set ObjRS = Objcmd.Execute

IF ObjRS.EOF THEN
Response.Write "Sorry, no records were found for that searchterm"
else
response.Write(objRs.fields("UserId"))
end if

When I run this it throws :
(Operation is not allowed when the object is closed.)

My sp runs fine when I execute in SSMS ,It returns rows.

There is somthing wrong ,not sure .Please help on this




Similar Threads
Thread Thread Starter Forum Replies Last Post
Operation is not allowed when the object is closed. adamhw Classic ASP Basics 5 June 4th, 2010 05:57 AM
Operation is not allowed when the object is closed. Hannibal Classic ASP Basics 0 April 7th, 2010 10:45 AM
Operation is not allowed when the object is closed lightmaker Classic ASP Basics 1 June 6th, 2008 12:29 PM
Operation is not allowed when the object is closed kingroon Classic ASP Databases 2 February 5th, 2008 10:29 AM
Operation is not allowed when the object is closed kah Javascript How-To 2 February 16th, 2005 07:20 AM





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