Click to See Complete Forum and Search --> : Display tables using ASP


klysdale
03-04-2006, 12:38 PM
I an trying to create a web based database using ASP and Microsoft Access. I can retrieve data form the tables within Access. However, I use the html select tag and it puts the data into a drop down list. I would like to be able to display the data in a table in my browser. I tried using the table html tag, but that just displayed the data by itself. I very well could have forgotten something simple. Hopefully not. Any help would be appreciated. I can other info if needed. Thank you.

TheBearMay
03-04-2006, 01:32 PM
Was going to write this up but remembered an example from W3Schools:
<html>
<body>

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("/db/northwind.mdb"))

set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT Companyname, Contactname FROM Customers", conn
%>

<table border="1" width="100%">
<%do until rs.EOF%>
<tr>
<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%></td>
<%next
rs.MoveNext%>
</tr>
<%loop
rs.close
conn.close
%>
</table>

</body>
</html>

klysdale
03-04-2006, 02:53 PM
Thank you, I will try this is out.

klysdale
03-04-2006, 05:13 PM
I was to get that to work. I appreciate your help. Now I need to figure how to make the table variable. I was able to pull particular data using WHERE. However, that is hard coded. I would like that to be variable from whatever is selected on the previous page. I checked out W3 schools, but all they show me is a simple HTML donald duck example.

Also, is Java the only way I can having "floating forms"? I would like to have two drop down menus and the data in the second one is dependent upon what is selected in the first. Hopefully ASP can do that. This should hopefully be all the help I ask for.

Thank you,