For Programmers: Free Programming Magazines  


Home > Archive > ASP > July 2004 > Displaying recordsets









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Displaying recordsets
Steve Marciniak

2004-07-15, 3:55 pm

I'm trying to display different recordsets (which are 1 field each) as
columns right next to one another. For example, Recordset1 is
displayed on the left hand side of the screen. Recordset2 is displayed
immediately to the right of then first recordset with the first rows
or each at the same level. Recordset3 is displayed to the right of
Recordset2 and so on. There is no set limit to the number of possible
recordsets (or columns to display). Imagine a spreadsheet where each
column is a different recordset. How can I display that using ASP?
Aaron [SQL Server MVP]

2004-07-15, 3:55 pm

The first idea would be to write a better query so there aren't n recordsets
at all?

--
http://www.aspfaq.com/
(Reverse address to reply.)




"Steve Marciniak" <smarciniak@snl.com> wrote in message
news:b45f019a.0407151023.9a01ffe@posting.google.com...
> I'm trying to display different recordsets (which are 1 field each) as
> columns right next to one another. For example, Recordset1 is
> displayed on the left hand side of the screen. Recordset2 is displayed
> immediately to the right of then first recordset with the first rows
> or each at the same level. Recordset3 is displayed to the right of
> Recordset2 and so on. There is no set limit to the number of possible
> recordsets (or columns to display). Imagine a spreadsheet where each
> column is a different recordset. How can I display that using ASP?



Jeff Cochran

2004-07-15, 8:56 pm

>"Steve Marciniak" <smarciniak@snl.com> wrote in message[color=darkred]
>news:b45f019a.0407151023.9a01ffe@posting.google.com...

I agree with Aaron on the recordsets, but if you must do this, you'll
need to display the recordset using a table. As you loop through the
recordset, build everything in a table cell, then close the tag and
move to the next record and next cell.

Something like (Code is likely not going to work as written, I type
too poorly and am doing this from a feeble memory...):

(Assumes you have a recordset objRS)

Response.Write <table><tr>
Do While Not objRS.EOF
Response.Write <td>
For Each Field in objRS.Fields
Response.Write Field.Value & "<br>"
Next
Response.Write </td>
objRS.MoveNext
Loop
Response.Write </tr></table>

Jeff
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com