View Full Version : Recordset or maybe SQL, help appreciated

04-19-2006, 04:21 PM
I need a ASP page to grab info from 2 different database tables; heres the connection object and SQL for a single table called articles;

Set RS = Con.Execute("SELECT * FROM article")

heres an example output delimeter for articles;
<h1><%= RS.Fields("article_name").Value %></h1>

How do I get info from the articles table and the products table?

Any help really appreciated, Anthony:)

04-19-2006, 04:24 PM
Are the tables associated?

Here is an example of basic joins

04-19-2006, 07:45 PM
The tables are not relational!, I just want to pull the info from 2 different tables.

thanks for the link; I had a look through the link but didnt see anything that helped me.

Thanks for trying, Anthony

04-21-2006, 05:20 PM
you could create two different recordsets

Set RS = Con.Execute("SELECT * FROM article")
Set RS1 = Con.Execute("SELECT * FROM products")

heres an example output delimeter for articles;
<h1><%= RS.Fields("article_name").Value %></h1>
'Just use RS1 for the second recordset values.
<p><%= RS1.Fields("product_name").Value %></p>

04-21-2006, 08:17 PM
Thanks for the reply, mehere. :)

Great idea, I haven't found a book that shows a method of using two record sets and didn't actually know you could do that.

I have, however, just minutes ago implemented a page that uses three record sets using includes.

Does any one know any reason for not using asp includes?

Thank you for very much for your reply, all comments very welcome.


04-25-2006, 04:51 PM
Depends on how your site is setup and what the includes contain.

SSI includes are bad for conditional includes because they are not infact conditional. They will be included whatever and only output the conditional content.

Server.Execute is a method that could be used. Again, depending on what the includes contain.

For static pages you could use the FileSystemObject or XMLHTTP to read the file and output the content.