Why this error???Operation is not allowed when the object is closed.

Reply

Join Date: Jun 2006
Posts: 17
Reputation: Qcdms21 is an unknown quantity at this point 
Solved Threads: 1
Qcdms21's Avatar
Qcdms21 Qcdms21 is offline Offline
Newbie Poster

Why this error???Operation is not allowed when the object is closed.

 
0
  #1
Sep 17th, 2006
i m doing a simple timetable in timetable.asp with the following codes ,i created three links to view different levels of timetable. we got level 1 ,2 and 3. as this VIEW BY LEVEL 1 2 3

:mrgreen: so i pass the string 1 ,2 and 3.
<%
if request.QueryString("lowchar")="1" then

rs2.Open "select time_id,day,time,subject from timetable where course_code = 'H-170-1'" , conn ,1,2

else

if request.QueryString("lowchar")="2" then rs2.Open "select time_id,day,time,subject from timetable where course_code = 'H-170-2'" , conn ,1,2

else

if request.QueryString("lowchar")="3" then rs2.Open "select time_id,day,time,subject from timetable where course_code = 'H-170-3'" , conn ,1,2

end if
end if
end if

rno=0
while not rs2.EOF // this line show the above error
rno=rno+1
if rno mod 2=0 then
bgcolor="#ffffcc"
else
bgcolor="#ffff99"
end if

%>

Operation is not allowed when the object is closed. Do i need to define a new object? or maybe open a object? if so where n how? thank you dani webbies and especially chmonalisa, u r wonderful person.
:lol: :lol: :lol: :mrgreen: :twisted: :twisted: :twisted: :twisted:
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 107
Reputation: madmital is an unknown quantity at this point 
Solved Threads: 3
madmital madmital is offline Offline
Junior Poster

Re: Why this error???Operation is not allowed when the object is closed.

 
0
  #2
Sep 25th, 2006
You figured it out yet?
The error tells you that RS2 is not open...that mean none of your evaulations return true.
Either rewrite your code to include an "else" the no nested conditional action, or check if RS2 is open before "rs2.eof". You can do this by "rs2.state"
Web Developer
When something seems too good to be true...it usually is
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 17
Reputation: Qcdms21 is an unknown quantity at this point 
Solved Threads: 1
Qcdms21's Avatar
Qcdms21 Qcdms21 is offline Offline
Newbie Poster

Re: Why this error???Operation is not allowed when the object is closed.

 
0
  #3
Sep 27th, 2006
Yes , i figured it out.

this is the way

if rs2.State <> 1 then

rs2.Open"select time_id,day,time,subject,course_code,lecturer,venue from timetable where course_code like '" & id & "%'", conn,2,1

end if

while not rs2.EOF
:lol: :lol: :lol: :mrgreen: :twisted: :twisted: :twisted: :twisted:
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 234
Reputation: cancer10 is an unknown quantity at this point 
Solved Threads: 0
cancer10's Avatar
cancer10 cancer10 is offline Offline
Posting Whiz in Training

Re: Why this error???Operation is not allowed when the object is closed.

 
0
  #4
Oct 12th, 2006
The best way of finding an answer to an asp program is to copy the error code and paste it in google.com then perform a search, you will defenately come to know the solution of your problem.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC