If I add another const to the existing 2, I get "subscript out of range" error
However, if I disable it,
lastID = rows(UBound(rows,2),COL_BLKID, I get no errors but I get no result either.
What I am trying to do is get the first number that appears on our result set and the last one there.
So far it isn't working.
Any urgent help would be greatly appreciated.
Just in case this might help, here is the query I am using:
rs = "SELECT Full_Name, userid,from, To FROM mytable where ID =" & ID & " order by userid"
' Assign symbolic names to the columns in that array
CONST COL_NAME = 0
CONST COL_BLKID = 1
' How many rows are there?
BlockCount = UBound(rows,2) + 1
' full_name should be same in all rows, so get it from first row:
full_name = rows(0,COL_NAME)
' first id is in first row:
firstID = rows(0,COL_BLKID)
' last id is in last row:
lastID = rows(UBound(rows,2),COL_BLKID)