PDA

View Full Version : printing pulled database records


havey
07-29-2003, 08:06 PM
Hello,

I'm need to post to another asp and i'm using:
<%Response.Write "<input type=""hidden"" name=""a1"" value='" & Trim(rs("a1")) & "'>"%>

a1 is one of 120 fields. For evey field i'm currently doing like so:

<%IF Trim(rs("a1")) > "" THEN%><li><font face="Verdana" size="1"> <%=Trim(rs("a1"))%></font></li>
<%Response.Write "<input type=""hidden"" name=""a1"" value='" & Trim(rs("a1")) & "'>"%><%END IF%>

I was wondering if i could somehow have a loop that i can put in the between the form tags that will do this for every field? something like so:
<%
For Each thing In rs
Response.Write "<input type=""hidden"" name=""" & thing & """ value=""" & rs(thing) & """>" & vbCrLf
Next
%>

glenngv
07-30-2003, 05:12 AM
For Each objField In objRecordset.Fields
Response.Write "<input type=""hidden"" name=""" & objField.name & """ value=""" & objField.value & """>" & vbCrLf
Next