B
Bryan Harrington
Ok.. so I'm using a .CLASSIC Sub that basically returns a datagrid that is
sortable and does paging. It's very handy since it's fairly generic in that
I can pass it a SQL query and it populates the datagrid using the database
field names as column headings.
So.. my problem, I need the ID of record so I can pass it on the QS to an
edit page, but I don't want to display it as the first column.
Below is the snippet of code, and it does a for each field in RS.Fields...
how do I say skip the first item in the collection?
Thanks!
'display from the current record to the pagesize
for i = intCurrentRecord to RS.PageSize
if not RS.eof then
Response.Write "<tr>" & vbcrlf
'for each field in the recordset
for each field in RS.Fields
Response.Write "<td>" & vbcrlf
'if this field is the "linked field" provide a link
if lcase(strLinkedColumnName) = lcase(field.name) then
Response.Write "<a href=" & strLink & rs("id") & ">" & field.value &
"</a>" & vbcrlf
else
Response.Write field.value
end if
Response.Write "<td>" & vbcrlf
next
Response.Write "<tr>" & vbcrlf
RS.MoveNext
end if
next
sortable and does paging. It's very handy since it's fairly generic in that
I can pass it a SQL query and it populates the datagrid using the database
field names as column headings.
So.. my problem, I need the ID of record so I can pass it on the QS to an
edit page, but I don't want to display it as the first column.
Below is the snippet of code, and it does a for each field in RS.Fields...
how do I say skip the first item in the collection?
Thanks!
'display from the current record to the pagesize
for i = intCurrentRecord to RS.PageSize
if not RS.eof then
Response.Write "<tr>" & vbcrlf
'for each field in the recordset
for each field in RS.Fields
Response.Write "<td>" & vbcrlf
'if this field is the "linked field" provide a link
if lcase(strLinkedColumnName) = lcase(field.name) then
Response.Write "<a href=" & strLink & rs("id") & ">" & field.value &
"</a>" & vbcrlf
else
Response.Write field.value
end if
Response.Write "<td>" & vbcrlf
next
Response.Write "<tr>" & vbcrlf
RS.MoveNext
end if
next