Multiple recordsets?

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Multiple recordsets?

    Hey all

    I'm not sure if there's anything that can be done about this or not. I'm displaying the contents of two different tables (using Access for development purposes, but when I go live we'll convert it o SQL Server) on an ASP page. One table, called NewAccts, contains (surprise) new accounts. The other table contains account challenges, and it's called Deducts. The two tables have a few columns in common, with AccountNum forming the PK (NewAccts) - FK (Deducts) relationship between the two tables

    Not every account will have a record in Deducts. On my display page, I want to display ALL accounts, ordered by a date field in the NewAccts table. If there is a matching record in the Deducts table, I want to display it directly beneath the record from NewAccts.

    The way I currently do this is I loop through the NewAccounts table, and for each record, check the Deducts table for a match. I have to think this is terribly inefficient and I'd LIKE to find something that employs just a single recordset (so that I can use GetRows and be done with it). Is this a UNION query situation? I'm honestly not sure if this can even be done - or if I've explained what I want in enough detail.

    I hope someone can shed some light on this for me.
    MDW Guest

  2. Similar Questions and Discussions

    1. Multiple Recordsets
      OK, I know there has to be a better way to do this, hopefully someone can shed some light on this subject. Using SQLServer 2000 and VBscript...
    2. Multiple paged recordsets
      Does anyone know how to place two or more INDEPENDENTLY PAGEABLE different sized recordsets on the same output page using DM8/ASP? I have created...
    3. Multiple Recordsets and Stored Procedure
      I'm using a stored procedure that returns multiple recordsets (it contains multiple select statements) in a vb.net dev environment. The problem is...
    4. Getting Multiple Recordsets from an SP
      I am using ASP 3.0/ADO to call an SP. The SP has multiple SELECT statements so I need to get the multiple return sets but I cannot find the right...
    5. Should open multiple recordsets, or just one?
      Hi, I find myself once again returning to a problem project I have been so far unable to finish... I have a table of teaching session data and...
  3. #2

    Default Re: Multiple recordsets?

    [url]http://www.aspfaq.com/2241[/url]

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    "MDW" <anonymous@discussions.microsoft.com> wrote in message
    news:9C263BD1-0EA3-4D36-8594-BFC4314EC43D@microsoft.com...
    > Hey all,
    >
    > I'm not sure if there's anything that can be done about this or not. I'm
    > displaying the contents of two different tables (using Access for
    > development purposes, but when I go live we'll convert it o SQL Server) on
    > an ASP page. One table, called NewAccts, contains (surprise) new accounts.
    > The other table contains account challenges, and it's called Deducts. The
    > two tables have a few columns in common, with AccountNum forming the PK
    > (NewAccts) - FK (Deducts) relationship between the two tables.
    >
    > Not every account will have a record in Deducts. On my display page, I
    > want to display ALL accounts, ordered by a date field in the NewAccts
    > table. If there is a matching record in the Deducts table, I want to
    > display it directly beneath the record from NewAccts.
    >
    > The way I currently do this is I loop through the NewAccounts table, and
    > for each record, check the Deducts table for a match. I have to think this
    > is terribly inefficient and I'd LIKE to find something that employs just a
    > single recordset (so that I can use GetRows and be done with it). Is this
    > a UNION query situation? I'm honestly not sure if this can even be done -
    > or if I've explained what I want in enough detail.
    >
    > I hope someone can shed some light on this for me.

    Aaron Bertrand [MVP] Guest

  4. #3

    Default Re: Multiple recordsets?

    If you use LEFT JOIN instead of INNER JOIN in a SQL statement you can
    show all records in one table (perhaps that match some criteria) and
    only those records that are linked in the other table...

    Best regards,
    J. Paul Schmidt, Freelance ASP Web Consultant
    [url]http://www.Bullschmidt.com[/url]
    ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...


    *** Sent via Devdex [url]http://www.devdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Bullschmidt Guest

Posting Permissions

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

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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139