If I understand the original question, then both these response seem incorrect. My interpretation of your response is that the "loop" will stop at the first occurence of a distance < 25. The poster seem to be asking for loop that will display only distants under 25, which I interpret as " show me all the distants that are < 25.
Therefore, he must use something such as :
do while not rs.eof
if rs("distant")<25 then
response.write " display me" ' or whatever he wants to do