Having two record sets

This is a discussion on "Having two record sets" within the Classic ASP section. This forum, and the thread "Having two record sets are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 11th, 2004, 19:45
Junior Member
Join Date: Aug 2004
Location: United Kingdom
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Having two record sets

What i want is a table of pictures and comments.

Pictures on the left, and the four most recent comments about the pictures on the right.

I have a database table of pictures, with a picture ID as unique, and also a comments table, also having the picture ID, how can i get a recordset from both at the same time??

  #2 (permalink)  
Old Oct 11th, 2004, 21:02
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
use a JOIN in your databse query, based on the matching PictureID.
Which database are you using?
  #3 (permalink)  
Old Oct 12th, 2004, 14:17
Junior Member
Join Date: Aug 2004
Location: United Kingdom
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
access, if I do a join how will the recordset be arranged?

because the amount of comments is many to one picture.

I shall try it and see what happens
  #4 (permalink)  
Old Oct 12th, 2004, 15:31
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
you'll need to 'group by' the PictureID I think
  #5 (permalink)  
Old Oct 12th, 2004, 23:14
Junior Member
Join Date: Aug 2004
Location: United Kingdom
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
i have made a query in my access database which seems to do the trick, couldnt get the SELECT FROM to work, kept getting FROM syntax error
  #6 (permalink)  
Old Oct 13th, 2004, 06:58
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
For acceesm try 'Select * From'
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
  #7 (permalink)  
Old Oct 22nd, 2004, 04:55
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,620
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
I know I'm late, but I don't think you cant use "SELECT *" when joining tables

also, he wants to get one record from the pictures table and 4 from the comments table.
best to do is:
- load picture record
- save id as a variable
- close picture recordset
- load comments used the saved id
- blah blah blah...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
  #8 (permalink)  
Old Oct 22nd, 2004, 06:14
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
One method is called data shaping. It let's you return a recordset as a field in another recordset. (I know that's not a very clear description)

Check out http://www.4guysfromrolla.com/webtech/092599-1.shtml or google it.
Closed Thread

Tags
having, two, record, sets

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
record keeping karmaman E-Commerce and Business 1 Sep 19th, 2007 10:45
Updating a record Wheatus7 Classic ASP 0 Jun 3rd, 2007 06:56
Record videos on your pc Pádraig Webforumz Cafe 10 May 2nd, 2007 19:04
insert record accessman Databases 1 Oct 15th, 2005 01:12
Insert Record redkyna Classic ASP 11 Aug 25th, 2004 22:46


All times are GMT. The time now is 00:14.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43