Forums

ASP

This topic is locked

Random database display

Posted 07 Apr 2003 18:20:02
1
has voted
07 Apr 2003 18:20:02 Robert Kennedy posted:
OK. Here's the situation. I have a page that I have my cd reviews on. I have my database set-up so that the artist names are listed on the main reviews page and when they click the name, the review is brought up along with the artist picture on another page. WHat I would like to do in addition is have the set up a section of my main site page to pull abstracts of these reviews from the database randomly for a certain section of that page. Is there anyway to do this?? There are javascripts and other scripts to do this so I figure there has to be a way to do it in ASP. Any help ideas??

Replies

Replied 07 Apr 2003 20:23:27
07 Apr 2003 20:23:27 Brent Colflesh replied:
Depends what your database backend is -

MS SQL - use the RAND() function in your query

MS Access - use the RND() function in your query

Regards,
Brent

Replied 08 Apr 2003 22:22:51
08 Apr 2003 22:22:51 Robert Kennedy replied:
I am using Access as my backend. I am new to ASP so everything that I do I am doing by reading. So I need step by step on this. I know how create a recordset and set it up for like a news update list to be displayed. But now I want to randomly select items from that list to be displayed everytime a page is loaded without people having to click a link of any sort. DOes that help more?
Replied 08 Apr 2003 22:52:25
08 Apr 2003 22:52:25 Brent Colflesh replied:
"select TOP 10 intQuestionID, txtQuestion, Rnd(intQuestionID) FROM tblQuestions WHERE intGroupID=1 ORDER BY Rnd(intQuestionID)"

example from:

www.experts-exchange.com/Web/Web_Languages/ASP/Q_20251179.html

Regards,
Brent

Reply to this topic