Click to See Complete Forum and Search --> : calendar array not displaying first event of every month


kredd
09-17-2005, 07:29 PM
hello all,
creating an array of calendar events from a recordset. i use 'select count' to make sure there are records for the month selected, if so, i put them into the array.

the problem is that if there is only one event for the first day of the month it won't display it. if there are two events on the first day it will start with the second event on the first day. all other days for every month display fine... its just the very first event for the very first day of every month. i'm using get.rows to create my array.

i've also written out the array and manually counted the number of events for a given month and checked it against the 'select count' method and both numbers match. it seems the problem isn't with getting the info from the database, but with writing out the array. :confused:

thanks!
kelly

slyfox
09-18-2005, 09:16 AM
arrays always start at 0, not 1... just make sure you get the info beginning at 0

kredd
09-18-2005, 02:57 PM
thanks, but i am starting with 0.

if i do this...


<% for iiii = 0 to UBound(eventsArray,2) %>
<% response.write eventsArray(0,iiii) & "&nbsp;,&nbsp;"& eventsArray(2,iiii) & "<br>" %>
<% Next %>


i get a 'ID' , 'EVENT NAME' list. the funny thing is that it will actually display the ID number for that first event of the month but the EVENT NAME is still empty. so it knows its there, it just won't display it...

kredd
09-18-2005, 03:22 PM
this is why it wasn't working...



dbday = calendar.Fields.Item("day").Value
dbevent = calendar.Fields.Item("subject").Value

eventsArray = calendar.getrows



as soon as i commented out the two variables everything worked fine. i don't know how or why but the vars were grabbing the values in the recordset first so that the array couldn't use them. turns out i wasn't even using those variables anymore so all is well.