jollyreaper
Technical User
I know that there's a way to do this, I know my pseudocode should be close (hopefully) to correct.
I want to be able to take a given table from the database and display all records for all fields without having to manually type in the field names. I remember that you're supposed to be able to reference the fields by number as well.
'database connection jibber jabber
Set RS = Connection.Execute("select * from mytable")
<%
'me looping through all records in the database
While (NOT rs.EOF)
%>
<table width="494" height="222" border="1">
<tr>
<%'display all fields in record
fieldmax=some function to determine # of fields in table, how?!?
set fieldnum=1
while (fieldnum>=fieldmax)
<td><%=RS.Fields("somehow print fieldname for field x, how?!") </td>
<td><%= RS.Fields(fieldnum)%></td>
<%fieldnum=fieldnum+1
wend
%>
</tr>
</table>
<%rs.MoveNext
wend
%>
In case anyone is wondering what the goal here is, we've got people external to the company who need access to data from our database and given the situation, it's easier to put it in xml on an https webserver than any other solution we could come up with. I left the xml out of the example to simplify things.
Any feedback would be greatly appreciated!
I want to be able to take a given table from the database and display all records for all fields without having to manually type in the field names. I remember that you're supposed to be able to reference the fields by number as well.
'database connection jibber jabber
Set RS = Connection.Execute("select * from mytable")
<%
'me looping through all records in the database
While (NOT rs.EOF)
%>
<table width="494" height="222" border="1">
<tr>
<%'display all fields in record
fieldmax=some function to determine # of fields in table, how?!?
set fieldnum=1
while (fieldnum>=fieldmax)
<td><%=RS.Fields("somehow print fieldname for field x, how?!") </td>
<td><%= RS.Fields(fieldnum)%></td>
<%fieldnum=fieldnum+1
wend
%>
</tr>
</table>
<%rs.MoveNext
wend
%>
In case anyone is wondering what the goal here is, we've got people external to the company who need access to data from our database and given the situation, it's easier to put it in xml on an https webserver than any other solution we could come up with. I left the xml out of the example to simplify things.
Any feedback would be greatly appreciated!