Using the follwing query
select distinct code from oalr where code > '" & AlertCode & "' and code<=('" & code & "') "
i got 5 records eg :5603,5604,5605,5606,5607
record set fetching
Ocode = CStr(rs4.Fields.Item(0).Value)
Here Ocode get only last record eg :5607, i want to take this 5 records in the loop how can i write the coding