View Single Post
Old Jan 14th, 2006, 12:50 AM   #4
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
dim rArray(9) <-- Assumes that there are always 9 fields

sql = "select rate from mort"

set recset = adocon.execute(sql)

do while (not recset.eof) 

  for i=0 to recset.fields.count-1

  rArray(i)= recset(i) <-- Sets rArray(i) to recset(i). This happens, for 0 to recset.fields.count -1, for each record. In other words, rArray in the end contains only the data from the last recordset


  next <-- Yes, i is incremented...handle the next of the fields

recset.moveNext

loop <-- handle the next record

response.write rArray(0) <-- The first field of the last record. See above.

You are copying the data from one array to another for each record and only returning the copied data after it has been overwritten several times.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote