To return a recordset to the browser you would use the Recordset object. Once the recordset is returned,it is necessary to place the fields within the HTML tags to produce a table from the results.





 











<html>


<head>


<title>


</title>


</head>


<body>


<%


Set cn = Server.CreateObject("ADODB".Connection")


cn.Open "Company"


Set rs =cn.Execute "SELECT FirstName,LastName FROM Employees"


rs.MoveFirst


%>


<table border="1">

<TBODY>

<tr>

<td>First name</td>

<td>Last name</td>

</tr>


<% Do While Not rs.EOF %>


<tr>


<td>


<% Response.Write rs("FirstName") %>


</td>


<td>


<% Response.Write rs("LastName")  %>


</td>


<% rs.Movenext %>


</tr>


<% Loop %>


</table>


<% rs.close


set rs = nothing


cn.close


set cn=nothing


%>


</body>


</html>




                    

Copyright © 2010 VisualBuilder. All rights reserved