The data is returned in a two dimension array the first dimension is the columns, the second the rows. So it's simply processed as any other array.
number of columns = ubound(data_array,1)
number of rows (recordcount) = ubound(data_array,2)
To recover the last record (for instance) it would be
Code:
for i = 0 to ubound(data_array,1)
response.write data_array(i,ubound(data_array,2))
next
the first record would be
Code:
for i = 0 to ubound(data_array,1)
response.write data_array(i,lbound(data_array,2))
next
This is also where using an explicit fieldlist is important because the columns will always be returned in the same order (the fieldlist) even if the table gets restructured.
It can be a little daunting at first and you'll probably code it the wrong way around a few times, but it is worth persevering and learning as the speed increase in queries can be noticeable on a busy database.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|