Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Apr 2006
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Recordset or maybe SQL, help appreciated

    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

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Are the tables associated?

    Here is an example of basic joins
    http://computer-helpforum.com/asp/as...malization.asp

  • #3
    New Coder
    Join Date
    Apr 2006
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    thanks for feedback

    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
    Last edited by abrewitt; 04-19-2006 at 07:54 PM.

  • #4
    Regular Coder
    Join Date
    Jan 2005
    Posts
    155
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you could create two different recordsets
    Code:
    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>

  • #5
    New Coder
    Join Date
    Apr 2006
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Thanks for the reply

    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.

    Anthony

  • #6
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •