ASP for each loop with a database
Experimenting with ASP and need a little help with some ASP.
Here's what I have. It returns 6 rows of the same thing. What do I need to do differently?
I am guessing that it has to do something with the recordset, but, being new to ASP, I have no idea.
-Steve
Experimenting with ASP and need a little help with some ASP.
Here's what I have. It returns 6 rows of the same thing. What do I need to do differently?
Code:
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "C:\Inetpub\wwwroot\IT-Site\db1.mdb"
set thistask = Server.CreateObject("ADODB.recordset")
thistask.Open "Select * FROM this_week_tasks", conn
for each x in thistask.fields
response.write("<tr>")
response.write("<td>")
tid = thistask.Fields.Item("TaskID")
response.write(tid)
response.write("</td>")
response.write("<td>")
act = thistask.Fields.Item("Activity")
response.write(act)
response.write("</td>")
response.write("<td>")
own = thistask.Fields.Item("Owner")
response.write(own)
response.write("</td>")
response.write("<td>")
tardate = thistask.Fields.Item("TargetDate")
response.write(tardate)
response.write("</td>")
response.write("<td>")
stat = thistask.Fields.Item("Status")
response.write(stat)
response.write("</td>")
response.write("</tr>")
next
%>
-Steve








