A little help with random records

Discussion in 'ASP General' started by Jeff Uchtman, Oct 26, 2005.

  1. Jeff Uchtman

    Jeff Uchtman Guest

    I have read 10000 opinions on returning random records and I am more
    confused now that before I started. I have a small access db that will
    contain 20 or so rows with 3 or 4 columns. I like to return a set of 6
    distinct rows and display the columns in html. I have seen response.write
    and loops but can't I throw the 6 random rows in a array and pull the data
    as I need it in the page? Examples?

    More confused than ever
    Jeff
     
    Jeff Uchtman, Oct 26, 2005
    #1
    1. Advertising

  2. Jeff Uchtman

    Evertjan. Guest

    Jeff Uchtman wrote on 26 okt 2005 in
    microsoft.public.inetserver.asp.general:

    > I have read 10000 opinions on returning random records and I am more
    > confused now that before I started. I have a small access db that
    > will contain 20 or so rows with 3 or 4 columns. I like to return a
    > set of 6 distinct rows and display the columns in html. I have seen
    > response.write and loops but can't I throw the 6 random rows in a
    > array and pull the data as I need it in the page? Examples?


    Why would you do that? It is quite possible with a serverside array with
    all records data, but at least tat would be uneducational.

    I hope your records have an unique index field.

    Simply get an array of the available index numbers and randomly select 6.

    Then pull the 6 from the database, using "SELECT ..WHERE id = " & IDnumber

    A mdb-database is random access.

    If you get stuck in some part of your coding this NG will help you out.



    --
    Evertjan.
    The Netherlands.
    (Replace all crosses with dots in my emailaddress)
     
    Evertjan., Oct 26, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luke Airig
    Replies:
    0
    Views:
    812
    Luke Airig
    Dec 31, 2003
  2. globalrev
    Replies:
    4
    Views:
    782
    Gabriel Genellina
    Apr 20, 2008
  3. Dan

    Delete records or update records

    Dan, May 10, 2004, in forum: ASP General
    Replies:
    1
    Views:
    474
    Ray at
    May 10, 2004
  4. Replies:
    3
    Views:
    679
    Anthony Jones
    Nov 2, 2006
  5. VK
    Replies:
    15
    Views:
    1,218
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page