MarkGG
06-21-2005, 09:06 AM
I have a database with four tables, Main(has just ID_NUM, NAME, TYPE), Facility, People, Town.
I want to make it so that when someone accesses the page it would load a list of all the entries in the Main table, so all the ID_NUMs, NAMEs, TYPEs. In addition I would like to make the NAMEs a link so that they may be clicked and it would take you to another page, but that is a bit more complicated. So, how do I get my Main table to load into an HTML table?
I have this but it isn't working
<HTML>
<%
Dim con,sql,constring
Set con = Server.CreateObject("ADODB.Connection")
%>
<!-- #include file="dbConnect.ssi" -->
<%
sql = "Select * from main order by ID_NUM"
'I open my connection
con.Open dbConnect
'I execcute
con.Execute(sql)
%>
<body bgcolor=#6699CC link="blue" vlink="blue" alink="blue">
<center><font size="4" color="black"><b>Edit Current Entries</b></font></center>
<hr width = 50% size =4>
<br>
</center>
From this page you may edit entires which are currently already in the database. This is a complete list of the database contents. Just click on one of the names and you will be taken to a page where you may edit the values.
<table border = "2" bgcolor="white">
<%
do until con.eof
response.write("<tr>" & "<td>" & con.fields("ID_NUM") & "</td>" & "<td>" & con.fields("NAME") & "</td>" & "<td>" & con.fields("TYPE") & "</td>" & "</tr>")>")
con.movenext
loop
con.close
%>
</table>
</body>
</HTML>
I want to make it so that when someone accesses the page it would load a list of all the entries in the Main table, so all the ID_NUMs, NAMEs, TYPEs. In addition I would like to make the NAMEs a link so that they may be clicked and it would take you to another page, but that is a bit more complicated. So, how do I get my Main table to load into an HTML table?
I have this but it isn't working
<HTML>
<%
Dim con,sql,constring
Set con = Server.CreateObject("ADODB.Connection")
%>
<!-- #include file="dbConnect.ssi" -->
<%
sql = "Select * from main order by ID_NUM"
'I open my connection
con.Open dbConnect
'I execcute
con.Execute(sql)
%>
<body bgcolor=#6699CC link="blue" vlink="blue" alink="blue">
<center><font size="4" color="black"><b>Edit Current Entries</b></font></center>
<hr width = 50% size =4>
<br>
</center>
From this page you may edit entires which are currently already in the database. This is a complete list of the database contents. Just click on one of the names and you will be taken to a page where you may edit the values.
<table border = "2" bgcolor="white">
<%
do until con.eof
response.write("<tr>" & "<td>" & con.fields("ID_NUM") & "</td>" & "<td>" & con.fields("NAME") & "</td>" & "<td>" & con.fields("TYPE") & "</td>" & "</tr>")>")
con.movenext
loop
con.close
%>
</table>
</body>
</HTML>