...

View Full Version : Looping through recordset until end?



mattboy_slim
01-03-2007, 09:13 PM
I'm using a 3rd party calendar script with highlighting by days, and I'd like to use it for a "calendar of events". However, the script is set to use static days, but I'm hoping I could loop through my recordset highlighting all days where events are occurring, unfortunately, I can't find good example code online on how to accomplish this with the right results.

Here is the code that I would like to loop through:


oCalendar.AddHightlight(rs_events.Fields.Item("f_datestart").Value)


If you need more information, please let me know,
Thanks in advance,
Matt

mattboy_slim
01-03-2007, 09:20 PM
Sorry, nevermind, I got it figured out. For those that hit this by searching, here was the fix:

<%
Dim RepeatRows
Dim RepeatIndex

RepeatRows = -1
RepeatIndex = 0
rs_events_numRows = rs_events_numRows + RepeatRows
%>

<%
While ((RepeatRows <> 0) AND (NOT rs_events.EOF))
oCalendar.AddHightlight(rs_events.Fields.Item("f_datestart").Value)
RepeatIndex=RepeatIndex+1
RepeatRows=RepeatRows-1
rs_events.MoveNext()
Wend
%>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum