PDA

Click to See Complete Forum and Search --> : Tables and ASP


brianh
Feb 7th, 2001, 10:16 AM
I am very new at ASP, I have somwhat fo a VB background. I want to simply display data in tables. Here is my code, how do I do this?
(This code breaks right now as you will see)

****************************************
<% @Language = VBScript %>
<%
Option Explicit
Dim objConn, objRs, strQ, strOut
set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\Reg4web\SYS\Novonyx\suitespot\docs\n44web\dbTest.mdb"

set objRs = Server.CreateObject("ADODB.Recordset")


strQ = "Select * from tblCheck"
objRs.Open strQ, objConn
%>
<html>
<body>
<table border="1">
<tr>

<%
While not objRs.EOF
& "<tr>" & Response.Write objRs("Name") & ">>"
objRs.Movenext
Wend
</td>


While not objRs.EOF
Response.Write objRs("In") & ">>"
objRs.Movenext
Wend
</td>
<td>
While not objRs.EOF
Response.Write objRs("Time") & ">>"
objRs.Movenext
Wend
objrs.close
objconn.close
set objRs = Nothing
set objConn = Nothing

%>


</tr>
</table>
</body>
</html>
****************************************

Feb 7th, 2001, 10:43 AM
Why don't you start by putting everything in one loop instead of three

<table>
While not objRs.eof
response.write "<tr><td>" & objRs("Name") & "</td>" &_
"<td>" & objRs("In") & "</td>" &_
"<td>" & objRs("Time") & "</td></tr>"
objRs.movenext
Wend
</table>

You'll have to adjust the layout to what you really want, of course.
If you're interested in a really great reference guide check out www.4guysfromrolla.com (it's a bit messy but once you get used to it you'll discover a treasure box of information)

good luck, I hope I helped you, if not, post again, ok?

brianh
Feb 7th, 2001, 10:50 AM
It works great - thank you!