Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loop not displaying all records 1

Status
Not open for further replies.

colinbell

Technical User
Jul 15, 2004
50
GB
Hi

I've got the following for an AtoZ page. problem is it is only displaying the first record it finds - if i use response.write it does display all the records

any ideas ?
thanks
keith

if not rsOutput.EOF and bValid = true then
rsOutput.Sort = "az_keywords ASC"
rsOutput.MoveFirst
Do Until rsOutput.EOF
if rsOutput("az_keywords") <> "" then
tempBODY = "<SPAN CLASS = ""plaintext"">"
tempBODY = tempBODY & "<a href='ILINK|" & rsOutput.Fields("id") & ",|'>" & rsOutput.Fields("az_keywords") _ & "</a><br />"
end if

if rsOutput.Fields("description") <> "" then
tempBODY = tempBODY & rsOutput.Fields("description") & "<br />"
end if
tempBODY = tempBODY & "<br />"
tempBODY = tempBODY & "</SPAN>"

rsOutput.MoveNext
Loop

end if
 
is your recordset only returning one record? i dont see any problems in the code above, what sql statement are you using?

[thumbsup2]DreX
aKa - Robert
 
Your first assignment in the loop is writing over thevalues from previous loops:
tempBODY = "<SPAN CLASS = ""plaintext"">"

change it to:
tempBODY = tempBODY & "<SPAN CLASS = ""plaintext"">"

and you should be good to go (though I didn't look to carefully at the rest of your code)

-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
Need an expensive ASP developer in the North Carolina area? Feel free to let me know.


 
Tarwn

thank you - seems simple now but I couldn't see it for the life of me
 
If I had a nickel for very time I had been there... ;)

-T

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
Need an expensive ASP developer in the North Carolina area? Feel free to let me know.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top