Author |
Topic |
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 29 December 2004 : 04:22:08
|
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 |
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 29 December 2004 : 16:11:56
|
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 |
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 29 December 2004 : 16:29:27
|
aha, fixed it... I had an rs in the function,which I renamed, fixing the problem |
-Stim |
|
|
D3mon
Senior Member
United Kingdom
1685 Posts |
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 29 December 2004 : 19:07:52
|
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. |
|
|
|
Da_Stimulator
DEV Team Forum Moderator
USA
3373 Posts |
Posted - 29 December 2004 : 19:40:14
|
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 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 29 December 2004 : 20:52:17
|
wooops, misread that then. |
|
|
|
|
Topic |
|