[thelist] RePost - One for the GURU's asp loop

Brian Delaney brian.delaney at mccmh.net
Mon May 2 11:13:43 CDT 2005


Thanks for the response. The problem I have is that the output of this is:

name  address  address1 city   state zip   name  address  address1 
city   state zip    name  address  address1 city   state zip

instead of:

name              name               name
address            address           address
address1        address1         address1
city state zip   city state zip     city state zip

Any Ideas?

Thanks




Brian Cummiskey wrote:

> Brian Delaney wrote:
>
>>> I need to write the records 3 companies per row:
>>>
>>> company1 company2 company3
>>> addr addr addr
>>> addr1 addr1 addr1
>>> city,state zip city,state zip city,state zip
>>
>
> in your select statement, only select the fields--  company, addr, 
> addr1, city, state, zip.
>
> <%
>
> ' Build the table -->   
>     if not rst.EOF then
> %>
>
>     <table>
>         <tr>
> <%
>
>     ' set up the 3 headers...
>         for x = 0 to rst.Fields.count - 1
>             Response.Write "<th>" & trim(rst.Fields(x).Name) & "</th>" 
> & vbcrlf               
>         next
>
>         for x = 0 to rst.Fields.count - 1
>             Response.Write "<th>" & trim(rst.Fields(x).Name) & "</th>" 
> & vbcrlf               
>         next
>
>         for x = 0 to rst.Fields.count - 1
>             Response.Write "<th>" & trim(rst.Fields(x).Name) & "</th>" 
> & vbcrlf               
>         next
>
>         ' end the header row...
>
>         response.write "</tr>"
>        
>        
>         do until rst.eof
>            
>             response.write "<tr>"
>
>        
>             ' now do this 3 times as well...
>                        
>             for x = 0 to rst.Fields.count - 1
>                 Response.Write "<td>" & trim(rst.Fields(x).Value) & 
> "</td>" & vbcrlf               
>             next
>            
>             rst.MoveNext
>            
>             for x = 0 to rst.Fields.count - 1
>                 Response.Write "<td>" & trim(rst.Fields(x).Value) & 
> "</td>" & vbcrlf               
>             next
>            
>             rst.MoveNext
>
>             for x = 0 to rst.Fields.count - 1
>                 Response.Write "<td>" & trim(rst.Fields(x).Value) & 
> "</td>" & vbcrlf               
>             next
>
>             Response.Write "</tr>" & vbcrlf   
>             rst.MoveNext
>         loop   
> %>
>     </table>
>
> %>
>
>
> if you want a border or something in between, you can always add 
> another <td></td> cell in between the columns of the header and the 
> data set.
>
> HTH
>

*
*
*
This message, including any attachments, is intended solely for the use of the named recipient(s) and may contain confidential and/or priveleged information.  Any unauthorized review, use, disclosure or distribution of this communication(s) is expressly prohibited.  If you are not the intended recipient, please contact the sender by reply e-mail and destroy any and all copies of the original message.


More information about the thelist mailing list