Hi clever people (thought I'd start with a bit of flattery)
I have a calendar on one of my sites that uses various tables to pull the information from. One of these tables is the Event Type, which contains the colour in which the link should be displayed.
so the table looks like this
TypeID, Name, Colour
1, League, Blue
2, Social, Red
There are 7 entries in total.
I read these into an array
Code:Set rsTypes = Server.CreateObject("ADODB.Recordset") rsTypes.Open "SELECT * FROM Type", Conn, 3, 3 dim colorArray colorArray=rsTypes.GetRows
In the Events table, I have an EventType that links it to the Type Table, and I use the following code to compare the type from the Events Table, with the Type in the array to get the colour
but, the problem I'm having is that for some reason (and I can't work out why), it only ever reads the first three records from the type tableCode:For i = LBound(colorArray) TO UBound(colorArray) If colorArray(0,i) = (rsEventsDay("EventType")) Then colorLink = colorArray(2,i) Next
I've added a response.write in the code to check what the array is, and this only outputs the first 3 records
I wondered if it was something else in the code that was affecting this, so I wroteCode:For i = LBound(colorArray) TO UBound(colorArray) Response.write colorArray(0,i) If colorArray(0,i) = (rsEventsDay("EventType")) Then colorLink = colorArray(2,i) Next
but the output is still only the first 3 rows....anyone have any ideas as to why? Is it related to the fact that there are 3 fields and so the array is being limited to just 3 records?Code:Set rsTypes = Server.CreateObject("ADODB.Recordset") rsTypes.Open "SELECT * FROM Type", Conn, 3, 3 dim colorArray colorArray=rsTypes.GetRows'(7,1,2) For i = LBound(colorArray) TO UBound(colorArray) response.write i & " - " & colorarray(0,i) & " <BR> next


(right side on this reply ) and agree

