Print Page | Close Window

Database tables

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5380
Printed Date: 30 March 2026 at 9:39pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Database tables
Posted By: nay27uk
Subject: Database tables
Date Posted: 30 August 2003 at 3:53pm

 Hi all.

Im new to this forum and to asp i have to say i have found this site invalubale in starting on the long road to lerning to programe using asp. I have searched the net wide and far for over a year and a half now for a asp tutorial and found them all to dificult to follow untill i found the tutorials within this site. Thanks to this site i have now produced my first asp script and started work on my second if you want to see my first you can see it here http://www.sell-uk.net/gbfree/view.asp - http://www.sell-uk.net/gbfree/view.asp Although this site has been an insperation i find myself at the point wher i would like to progress and my second project has a database with more than one table although the tutorials on this site are a great help they do not explane how to encoperate more than one database table into one asp page. This is what i would like for somone to please explaine to me please remember that im a compleat newbe to this and do not fully understand what things do what all i need to know is HOW do i use two database table that are not related in one asp page I.E one table would be the maine script table and the second would be a config table with bacground info text type and so on.

How do i do this

REGARDS

NATHAN




Replies:
Posted By: michael
Date Posted: 30 August 2003 at 11:11pm
If you want to query two tables that are not related to each other you would just sperate it in two queries. If one of them is just a config table do the query at the beginning of you page or put it into a header file which you can include into every page.
So basically unless you have two related tables just do one query after another ie using 2 recordsets.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: nay27uk
Date Posted: 31 August 2003 at 9:34am
Thanks very mutch but im not sure as how to do this i have tryed this by doubling all the code in the page fron the sql= statement ie twoXset rs =nothing and so on but this threw up errors


Posted By: michael
Date Posted: 31 August 2003 at 10:20am

'You general database connection here you only need that once unless they are 2 diff db's

strSQL1 = "Select * from table1"
set rs1 = conn.Execute(strSQL1)
If rs1.BOF or rs1.EOF THEN
 'Give message
ELSE
 WHILE NOT rs1.EOF
     Display your data
 rs1.MoveNext
 WEND
END IF

Set rs1 = NOTHING

strSQL2 = "Select * from table2"
set rs2 = conn.Execute(strSQL2)
If rs2.BOF or rs2.EOF THEN
 'Give message
ELSE
 WHILE NOT rs2.EOF
     Display your data
 rs2.MoveNext
 WEND
END IF

Set rs2 = NOTHING

'Close your db connection here



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net