I am using ACCESS DB, I would like to select a random record row from my database. It doesn't work from the SQL statment I found "SELECT column FROM table ORDER BY
RAND()"
It is a long time ago, but I remembered this thread, but when I read it again, I noticed something regarding another thing:
Mikesdotnetting
I know that a bunch of functions within Access are not supported by the Jet provider. If you try Replace() for example, you get a function not supported error. The way round this is to create a saved query and call that in the same way as a stored proc in SQL
Server
This is not true. When executing saved queries, they can only contain functions that are supported in Jet, otherwise they will raise an error also.
jasonsky
Member
312 Points
184 Posts
Problem with selecting a random row from my DB
Oct 22, 2011 01:26 PM|LINK
I am using ACCESS DB, I would like to select a random record row from my database. It doesn't work from the SQL statment I found "SELECT column FROM table ORDER BY RAND()"
Any idea? Thanks.
Jason
Mikesdotnett...
All-Star
154852 Points
19855 Posts
Moderator
MVP
Re: Problem with selecting a random row from my DB
Oct 22, 2011 03:49 PM|LINK
http://forums.asp.net/t/1158634.aspx/1?How+to+select+a+random+record+from+database
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
hans_v
All-Star
35986 Points
6550 Posts
Re: Problem with selecting a random row from my DB
Oct 22, 2011 11:42 PM|LINK
Off topic...
It is a long time ago, but I remembered this thread, but when I read it again, I noticed something regarding another thing:
This is not true. When executing saved queries, they can only contain functions that are supported in Jet, otherwise they will raise an error also.
jasonsky
Member
312 Points
184 Posts
Re: Problem with selecting a random row from my DB
Oct 23, 2011 01:45 PM|LINK
I tried. I have 16 records in database, but it keeps showing me 2 of the cords. Do you know what the problem is?
hans_v
All-Star
35986 Points
6550 Posts
Re: Problem with selecting a random row from my DB
Oct 23, 2011 06:13 PM|LINK
Not if you don't show us what exactly you're doing?