I’m currently learning ADO and do not know how to print field names to a table in an ASP document.
The following code prints the contents of the selected Table in a database but not the field names. I want the field names printed at the top of each respective column, how do you do it. Thanks in advance.
Here is the code:
<%
set conn=Server.CreateObject("ADODB.Connection"
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:\ASP\db4.mdb"
set rs=Server.CreateObject("ADODB.recordset"
rs.Open "Select * from uid", conn
%>
<table border="1" width="100%" bgcolor="#FFFFFF" cellspacing="1">
<tr>
<%do until rs.EOF%>
<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%> </td>
<%next
rs.MoveNext%>
</tr>
<%loop
rs.close
conn.close
%>
The following code prints the contents of the selected Table in a database but not the field names. I want the field names printed at the top of each respective column, how do you do it. Thanks in advance.
Here is the code:
<%
set conn=Server.CreateObject("ADODB.Connection"
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:\ASP\db4.mdb"
set rs=Server.CreateObject("ADODB.recordset"
rs.Open "Select * from uid", conn
%>
<table border="1" width="100%" bgcolor="#FFFFFF" cellspacing="1">
<tr>
<%do until rs.EOF%>
<%for each x in rs.Fields%>
<td><%Response.Write(x.value)%> </td>
<%next
rs.MoveNext%>
</tr>
<%loop
rs.close
conn.close
%>