Ask a Question related to ASP Database, Design and Development.
-
marcel #1
Trying to get a random rand
I have an interesting problem. Im trying to get a range
of random rows from an access db. I have no problems in
returning the random range the problem is that it is
always the same random rand in the same random order.
What becomes interesting is that if I use the DTC record
with the implementation/no Cache selected.
The random query returns truly random and different
results to all users.
What is the DTC doing and what can I do the the following
to get it to return truly random results instead of
pedictable random results:
sql="SELECT top 5 someID " &_
"FROM sometable " &_
"ORDER BY rnd(someID) "
dbname = "\thedb.mdb"
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;data
source="
ConnStr = ConnStr & Server.MapPath("theDBlocation")
& dbname
set connection=Server.CreateObject("ADODB.Connection")
Set recordset=Server.CreateObject
("ADODB.Recordset")
connection.open ConnStr
recordset.Open sql,connection,1,2
marcel Guest
-
rand()
I've built a page in Dreamweaver (php) pulling records from mysql with rand() order, displaying 1 record at a time with a navigation pane, it... -
what is rand?
Often, I see something called "rand" or ".rand" or "rnd" in url query parameter, for example in yahoo mail url. E.g. ... -
Using Math.random to go to random frames
Hello everyone. My cerebral density is preventing me from seeing the solution to this problem. I have the following code which causes the user to... -
Using rand() for 10 digit numbers????
Hi! I looked at the rand() at php.net which spoke about min and max random number. So, I use rand(0,9999999999) to get a 10 digit random number... -
Random image in a random place.
Anyone know javascript? I have a grid(4 x 4) of 16 spacer images and a few text links on the side. Each text link represents a different folder of... -
Ken Schaefer #2
Re: Trying to get a random rand
I don't think that works because the random number seed is cached, and
re-used for each subsequent query...
I'm not sure what information is being transmitted using the DTC (the
no-cache option looks like what you need!)
Cheers
Ken
"marcel" <marcel@edmedia.com.au> wrote in message
news:052d01c36531$c4ad4b00$a101280a@phx.gbl...
: I have an interesting problem. Im trying to get a range
: of random rows from an access db. I have no problems in
: returning the random range the problem is that it is
: always the same random rand in the same random order.
:
:
: What becomes interesting is that if I use the DTC record
: with the implementation/no Cache selected.
:
: The random query returns truly random and different
: results to all users.
:
: What is the DTC doing and what can I do the the following
: to get it to return truly random results instead of
: pedictable random results:
:
: sql="SELECT top 5 someID " &_
: "FROM sometable " &_
: "ORDER BY rnd(someID) "
:
: dbname = "\thedb.mdb"
:
: ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;data
: source="
: ConnStr = ConnStr & Server.MapPath("theDBlocation")
: & dbname
:
: set connection=Server.CreateObject("ADODB.Connection")
: Set recordset=Server.CreateObject
: ("ADODB.Recordset")
: connection.open ConnStr
: recordset.Open sql,connection,1,2
:
Ken Schaefer Guest



Reply With Quote

