Newbie using multiple recordsets

Discussion in 'ASP General' started by Darren, Apr 3, 2004.

  1. Darren

    Darren Guest

    Hi All,

    This should be a simple one, but I still can't work it out for myself.
    :(

    I have a webpage that I displays information from my access db. On one
    area of the page I will be displaying information from tblNews.

    But then I would like to close that recordset and open a new one with
    information from tblEvents.

    And then close that one and open another recordset from the
    tblContacts.

    You can probably tell from the tbl names that is a simple bulletin
    board, it's for a sports club. It displays the lastest club news,
    upcoming events and club contacts.

    Thanks in advance guys, I've spent an hour trying to find a decent
    tutorial online but have had no luck.

    Cheers,
    Darren Stahlhut
    Darren, Apr 3, 2004
    #1
    1. Advertising

  2. Darren

    Steven Burn Guest

    '// News....... obviously tblNews is your table
    rst.open = "Select * FROM tblNews", DB, adOpenStatic, adLockPessimistic
    strNews = rst("Latest")
    rst.close

    '// Events....... obviously tblEvents is your table
    rst.open = "Select * FROM tblEvents", DB, adOpenStatic, adLockPessimistic
    strEvents = rst("Upcoming")
    rst.close

    '// Contacts....... obviously tblContacts is your table
    rst.open = "Select * FROM tblContacts", DB, adOpenStatic, adLockPessimistic
    do until rst.eof
    strContacts = rst("Contacts") & vbcrlf
    loop
    rst.close

    response.write strNews & vbcrlf & strEvents & vbcrlf & strContacts

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    Disclaimer:
    I know I'm probably wrong, I just like taking part ;o)


    Darren <> wrote in message
    news:...
    > Hi All,
    >
    > This should be a simple one, but I still can't work it out for myself.
    > :(
    >
    > I have a webpage that I displays information from my access db. On one
    > area of the page I will be displaying information from tblNews.
    >
    > But then I would like to close that recordset and open a new one with
    > information from tblEvents.
    >
    > And then close that one and open another recordset from the
    > tblContacts.
    >
    > You can probably tell from the tbl names that is a simple bulletin
    > board, it's for a sports club. It displays the lastest club news,
    > upcoming events and club contacts.
    >
    > Thanks in advance guys, I've spent an hour trying to find a decent
    > tutorial online but have had no luck.
    >
    > Cheers,
    > Darren Stahlhut
    Steven Burn, Apr 3, 2004
    #2
    1. Advertising

  3. > do until rst.eof
    > strContacts = rst("Contacts") & vbcrlf
    > loop


    Whoops! You forgot rst.movenext, infinite loop! ;-)

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
    Aaron Bertrand [MVP], Apr 3, 2004
    #3
  4. Darren

    Steven Burn Guest

    hehe.....whoops :eek:\

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    Disclaimer:
    I know I'm probably wrong, I just like taking part ;o)


    Aaron Bertrand [MVP] <> wrote in message
    news:#...
    > > do until rst.eof
    > > strContacts = rst("Contacts") & vbcrlf
    > > loop

    >
    > Whoops! You forgot rst.movenext, infinite loop! ;-)
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
    Steven Burn, Apr 3, 2004
    #4
  5. Darren

    Bob Barrows Guest

    Darren wrote:
    > Hi All,
    >
    > This should be a simple one, but I still can't work it out for myself.
    > :(
    >
    > I have a webpage that I displays information from my access db. On one
    > area of the page I will be displaying information from tblNews.
    >
    > But then I would like to close that recordset and open a new one with
    > information from tblEvents.
    >
    > And then close that one and open another recordset from the
    > tblContacts.
    >
    > You can probably tell from the tbl names that is a simple bulletin
    > board, it's for a sports club. It displays the lastest club news,
    > upcoming events and club contacts.
    >
    > Thanks in advance guys, I've spent an hour trying to find a decent
    > tutorial online but have had no luck.
    >
    > Cheers,
    > Darren Stahlhut


    Can't you get the records from all these tables at once? Can they be joined?
    Unioned?

    If you provide a little more detail, we may be able to explain how to get
    this information in a single recordset.

    Bob Barrows
    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows, Apr 3, 2004
    #5
    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. AFN
    Replies:
    5
    Views:
    400
    dilipdotnet at apdiya.com
    Feb 11, 2004
  2. =?Utf-8?B?TWFkaXNvbg==?=

    SqlDataSource and multiple recordsets

    =?Utf-8?B?TWFkaXNvbg==?=, Jul 24, 2007, in forum: ASP .Net
    Replies:
    5
    Views:
    825
    Cowboy \(Gregory A. Beamer\)
    Jul 24, 2007
  3. Replies:
    3
    Views:
    236
    Bob Barrows [MVP]
    Feb 3, 2005
  4. stjulian
    Replies:
    1
    Views:
    180
    Bob Barrows [MVP]
    Nov 1, 2006
  5. Dooza
    Replies:
    3
    Views:
    189
    Dooza
    Jun 5, 2008
Loading...

Share This Page