View Single Post
 
Old June 11th, 2013, 09:53 AM
sonali sonali is offline
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