🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.databases.mssql-l
Article #53

Re: Returning Recordsets With Records In Random Order

#53
From: Shawn M. Hooper
Date: Sat, 19 Feb 2000 00:00
35 lines
2647 bytes
The only way I can think of doing this off the top of my head is to read
that data from the recordset into an array (does ASP support arrays??) and
then get random numbers from the array to show the data.

However, this could take up significant amounts of resources depending on
the size of the recordset.

Just my $.02




"Anthony Gatlin" <gatlina@yahoo.com> wrote in message
news:KJqr4.12655$8S2.373870@news1.rdc1.tn.home.com...
> Oh wise ones,
>
> I am writing a web based application that needs to retrieve the records
from
> a query in a random order.  Then once the records are "jumbled" the
> application can simply use the vbscript/ADO .movenext and .moveprevious
> methods. I have looked at several options but have found none that work.
The
> Order By Clause appears to only return records in ascending or descending
> order. It would be an absolute last resort to return a recordset and then
> try to randomly jump back and forth within the record set. The recordset
> really needs to be randomized once per session and then remain in the same
> order through multiple passes.
>
> Any advice or hints would be GREATLY appreciated!
>
> Thank you in advance.
>
> Anthony
>
>
Technical Details
Message-ID: <e_xr4.5037$c7.232905@news1.rdc1.on.wave.home.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <KJqr4.12655$8S2.373870@news1.rdc1.tn.home.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f816f,f3910254de00620e,start
X-Google-Attributes: gidf816f,public
X-Google-Thread: ff490,f3910254de00620e,start
X-Google-Attributes: gidff490,public
X-Google-Thread: 104de1,29c344e57cec3258
X-Google-Attributes: gid104de1,public
X-Google-Thread: 11301e,5313a2c849ed4de0
X-Google-Attributes: gid11301e,public
X-Google-Thread: f6611,f3910254de00620e,start
X-Google-Attributes: gidf6611,public
X-Google-Thread: 107d2f,f3910254de00620e,start
X-Google-Attributes: gid107d2f,public
X-Google-Thread: f8191,f3910254de00620e,start
X-Google-Attributes: gidf8191,public
From: "Shawn M. Hooper" <shawn@smh.on.ca>
Subject: Re: Returning Recordsets With Records In Random Order
Date: 2000/02/19
Message-ID: <e_xr4.5037$c7.232905@news1.rdc1.on.wave.home.com>
X-Deja-AN: 587421359
References: <KJqr4.12655$8S2.373870@news1.rdc1.tn.home.com>
X-Priority: 3
X-Mimeole: Produced By Microsoft MimeOLE V5.00.2919.6700
X-Complaints-To: abuse@home.net
X-Trace: news1.rdc1.on.wave.home.com 950971402 24.114.65.125 (Sat, 19 Feb 2000 06:43:22 PST)
Organization: @Home Network Canada
X-MSMail-Priority: Normal
NNTP-Posting-Date: Sat, 19 Feb 2000 06:43:22 PST
Newsgroups: bit.databases.mssql-l,comp.database.ms-sqlserver,comp.databases.ms-sqlserver,cz.comp.microsoft.sql,microsoft.public.sqlserver,microsoft.public.sqlserver.misc,microsoft.public.sqlserver.programming