Display Your Recordset Sideways   
 

Description: Display your recordsets sideways! Instead of displaying recordsets on your page one, then a line break, then another one, etc, why not display your records in a fashion that will more effectively use your available screen space? Horizontally!

In this example, we will demonstrate how to show an html table of records retrieved, and show those records three(3) cells across, per row.

<%@ LANGUAGE = "VBScript" %>

<%
Set cnDZ = Server.CreateObject("ADODB.Connection")
cnDZ.Open "DSN=yourDSNhere"
%>
<html><body>
<%
Set rs = cnDZ.Execute("SELECT * FROM TABLE")
   Not rs.EOF Then
        Response.Write"<table border=1>"
        LinkCount = 0
        Do Until rs.EOF
        'change this 3 to any number you like:
   LinkCount Mod 3 = 0 Then
   LinkCount <> 0 Then Response.Write"</tr>"
        Response.Write"<tr><td>"&rs("NAME")&"<br>"&rs("DESCRIP")&"</td>"
  
        Response.Write"<td>"&rs("NAME")&"<br>"&rs("DESCRIP")&"</td>"
   If
        LinkCount = LinkCount + 1
        rs.MoveNext
        Loop
    Response.Write"</tr></table>"
    rs.Close
Set rs = Nothing
   Response.Write"Sorry, no records were found!"
End If
%>
</body></html>
<%
cnDZ.Close
Set cnDZ = Nothing
%>


My3C's
perrychicker
It's easy... it's a PSACAKE!
Back | Tell A Friend | Search this Site
© 1998 - 2008 psacake.com
Version 3.23

Send me One Million FREE Guaranteed Visitors