Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Error: Object required on rs.movenext
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 29 December 2004 :  04:22:08  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I got this standard do while loop on a recordset, but I have an error that popped up thats completely new to me, I've never run into it before...

Microsoft VBScript runtime error '800a01a8'

Object required

/kpoll/kpoll.asp, line 51

Line 51 is

rs.movenext

Yes, the recordset is dimmed, and named "rs" - and there are records to loop through.... I'm stumped

-Stim

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 29 December 2004 :  07:09:02  Show Profile  Visit D3mon's Homepage
does rs get closed (or SET to NOTHING) anywhere inside the loop?


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 29 December 2004 :  16:11:56  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
nope


    strsql = "SELECT * FROM KPOLL_OPTIONS WHERE POLL_ID=" & PollId
    set rs = pConn.execute(strsql)
      do until (rs.eof)
        optValue = rs("OPTION_VALUE")
        optVotes = Cint(rs("OPTION_VOTES"))
        
	          hLine = not hLine
	          
	          if hLine then
	            bgColor = "lightblue"
	          else
	            bgColor = "#FFFFFF"
	          end if
	    if optVotes = 0 then
	      fPercent = 1
	    else
	      fPercent = getPercentage(PollId, optVotes)
	    end if
	    
	    response.write("<tr><td align=""left"" bgcolor=""" & bgColor & """>" & _
	    optValue & "(" & optVotes & ")<br />" & _
	    "<img src=""/kpoll/bar.gif"" style=""width: " & fPercent & "px; height: 7px;"" border=""0"" />" & _
	    "</td></tr>")
      rs.movenext
      loop

-Stim

Edited by - Da_Stimulator on 29 December 2004 16:15:04
Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 29 December 2004 :  16:29:27  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
aha, fixed it... I had an rs in the function,which I renamed, fixing the problem

-Stim
Go to Top of Page

D3mon
Senior Member

United Kingdom
1685 Posts

Posted - 29 December 2004 :  18:28:59  Show Profile  Visit D3mon's Homepage
if you prefic all your objects with the letters 'obj' than you can go some way to preventing this problem.


Snitz 'Speedball' : Site Integration Mod : Friendly Registration Mod
"In war, the victorious strategist only seeks battle after the victory has been won"
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 29 December 2004 :  19:07:52  Show Profile  Visit dayve's Homepage
you can also catch these problems by adding an Option Explicit. any undeclared variables will spit out an error and may have led you to the problem.

Go to Top of Page

Da_Stimulator
DEV Team Forum Moderator

USA
3373 Posts

Posted - 29 December 2004 :  19:40:14  Show Profile  Send Da_Stimulator an AOL message  Send Da_Stimulator a Yahoo! Message
I have option explicit... what was happening was I was calling the getPercentage function from within the rs loop, and in the function I opened another rs and closed it out, setting it to nothing, using the same object name, overwriting the main record set...

I fixed it by renaming the recordset in the function

-Stim
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 29 December 2004 :  20:52:17  Show Profile  Visit dayve's Homepage
wooops, misread that then.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.18 seconds. Powered By: Snitz Forums 2000 Version 3.4.07