VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Populates a table with records returned from a database

by Tony Heishman (2 Submissions)
Category: Active Server Pages
Compatability: ASP (Active Server Pages)
Difficulty: Unknown Difficulty
Originally Published: Thu 25th May 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Populates a table with records returned from a database

Rate Populates a table with records returned from a database



Set connection = Server.CreateObject("ADODB.Connection")
connection.Open strConnectionString
<html>

<table border="1" cellpadding="4" cellspacing="3" width="598" bordercolorlight="#000080">


<%Set RS = Server.CreateObject("ADODB.Recordset") 

strSQL = "SELECT * FROM tblYourTable WHERE field = whatever "
RS.Open strSQL, connection
    %>
    <%While NOT RS.EOF%>
        <td width="129" align="center"><font face="Arial"><font size="2"><%=RS("field1")%></font></font></td>
        <td width="65" align="center"><font face="Arial"><font size="2"><%=RS("field2")%></font></font></td>
        <td width="79" align="center"><font face="Arial"><font size="2"><%=RS("field3")%></font></font></td>
        <td width="86" align="center"><font face="Arial"><font size="2"><%=RS("field4")%></font></font></td>
        <td width="72" align="center"><font face="Arial"><font size="2"><%=RS("field5")%></font></font></td>
        <td width="77" align="center"><font face="Arial"><font size="2"><%=RS("field6")%></font></font></td>
    </tr>
    <%RS.MoveNext
    Wend
    RS.Close
    %>
    
</table>
</html>


Download this snippet    Add to My Saved Code

Populates a table with records returned from a database Comments

No comments have been posted about Populates a table with records returned from a database. Why not be the first to post a comment about Populates a table with records returned from a database.

Post your comment

Subject:
Message:
0/1000 characters