|
-
Feb 7th, 2001, 11:16 AM
#1
Thread Starter
Fanatic Member
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, 11:43 AM
#2
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?
-
Feb 7th, 2001, 11:50 AM
#3
Thread Starter
Fanatic Member
It works great - thank you!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|