Click to See Complete Forum and Search --> : Display only specific fields from table?


sanjuT
02-07-2005, 09:57 AM
How can I alter the code below to show only specific table fields?


<%
for index = 0 to rsComp.Fields.count -20
Field = rsComp.Fields(index).Name
response.Write ("<TD><FONT COLOR=#000000><b>" & Field & "</b></font></A><BR></TD>")
next
%>


Right now it takes off the last 20 fields, but the fields I want to display are not grouped together. Specifically, I need fields 1,6,9,23.

Do I manually have to hard-code the field columns?

Thanks.

sanjuT
02-07-2005, 10:33 AM
Forget it, I am changing the sql statenment in my stored proc instead.

Bullschmidt
02-09-2005, 08:08 AM
And it's usually good ASP programming practice not to assume that fields in a table in a database will always stay in the same order and never have a new field inserted... :)

sanjuT
02-09-2005, 04:47 PM
oh ya, that makes sense.

Thanks!