MS Access
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsDatabasesMS Access

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old April 10th, 2008, 01:09 AM
camarun20 camarun20 is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Apr 2008
Posts: 1 camarun20 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 33 sec
Reputation Power: 0
How to fetch random rows for every time you query

Hi ,
I constructed an MS access query in java to retrieve the rows in random.

The code snipet

Connection con = DriverManager.getConnection( database ,"","");
Statement s = con.createStatement()
strQry = "select top 10 S_No , Rnd(S_No) as exp from Questions order by Rnd(S_No) desc" ;
s.execute(strQry) ;


This is the query I used to fetch the records in random. When i tried executing this code several times it fetches only the same set of records each time.

Actually my requirement is , for every time you query this , it should fetch different records.


Please help me in this.

Thanks in advance
Arun kumar

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesMS Access > How to fetch random rows for every time you query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT