Home > ASP Development > Placing Random Records

Placing Random Records



I need to retrieve and display 6 random records from my database, but not sure how to place each record on my webpage



My sql statement looks something like this:

SELECT TOP 6 * FROM Ads WHERE Type="F"



Then, I have predesigned areas in the webpage to place the 6 randomly returned records so I couldn't use a loop. The loop would work if I had records displayed on the page one after another, but since I have each record returned going to different places of my page, I need to be able to plug each record into each correct section of my webpage. One record may appear on the left side of my page, the next record at the bottom of the page...etc

How do I go about doing this. Would I use something like the "NEXT" statement?

    
Guest


you could try rs.MoveNext before displaying the record in each subsequent spot.

Was this answer helpful ? Yes No   
Guest


Thanks, I will give that a try.

Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved