Display Your Recordset Sideways

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.

For demonstration purposes only! Please be aware of SQL Injection, and techniques to avoid.
<%@ LANGUAGE = "VBScript" %>
 Set cnDZ = Server.CreateObject("ADODB.Connection")
 cnDZ.Open "DSN=yourDSNhere"
 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>"
         LinkCount = LinkCount + 1
 Set rs = Nothing
    Response.Write"Sorry, no records were found!"
 End If
 Set cnDZ = Nothing
For a working example, see The Name Game

recordsets recorsets in columns access

Back To Top
© 1998 - 2017 psacake.com | My3C's

Version 7.2 | Advertise on this site