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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Randomizing Query Results

Status
Not open for further replies.

BomberMan2K

Programmer
Sep 19, 2007
36
0
0
IL
Hi,
I'm having an issue with randomizing an ACCESS query results.
I have an index of people, which I want to show in random order each time the page loads (the page is written in ASP of course).
I've tried the RND() approach - but it always returns the same result (even if I use a random key. Can't use Randomize() in ASP code so it will affect the query).
Sql Server has NEWID() function - to really randomize things, but that doesn't apply to Access DB.
Tried to construct a VB Script in the DB, but it can't be activate inside the query when being executed from ASP pages (or can it?!)

I would really appreciate any help or ideas...

Thanks guys,
Roman.
 
How many records and fields are you talking about?

Maybe do the query, load the recordset into an array, write randomly out of the array...
 
I've thought about that, and even checked the options... but I guess when you pass a hunderd records or so - it will get messy on the web server.
Or even if it's only 10 records, but 1000 people watch the page - it might just crash.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top