<%
'ThisPage.asp
dim strSQL, strConn, Conn, rs, arrResults, bolFail, t
strSQL = "SELECT UserId, AmountOwed, TotalPaid FROM ClientPayment"
strConn = "your connection-string"
set Conn = server.createobject("ADODB.CONNECTION")
Conn.open strConn
set rs = server.createobject("ADODB.RECORDSET")
rs.Open strSQL, Conn, 1, 3
If NOT(rs.bof AND rs.eof) then
arrResults = rs.getrows
Else
bolFail = TRUE
End if
rs.close
set rs = nothing
conn.close
set conn = nothing
if bolFail then
response.write "DATABASE RETURNED NOTHING!"
response.end
end if
response.write "<form name=theForm action=otherpage.asp method=post><table>"
for t = 0 to ubound(arrResults,2)
response.write "<tr><td><input type=hidden name='userid" & t & "' value='" & arrResults(0,t) & "'>" & vbcrlf
response.write "UserId: " & arrResults(0,t) & "</td><td>Amount owed <input type=text size=10 name='amnt" & t & "' value='" & arrResults(1,t) & "'></td>" & vbcrlf
response.write "<td>Total paid: <input type=text size=10 name='tpaid" & t & "' value='" & arrResults(2,t) & "'></td></tr>" & vbcrlf
next
response.write "</table><input type=hidden name=counter value='" & ubound(arrResults,2) & "'><input type=submit></form>"
%>
------------------------------- CUT HERE ----------------------------------
<%
'OtherPage.asp
dim strConn, Conn, t, strSQL
strConn = "your connection-string"
set Conn = server.createobject("ADODB.CONNECTION")
Conn.open strConn
for t = 0 to cint(request.form("counter"))
strSQL = "UPDATE ClientPayment SET AmountOwed = '" & request.form("amnt" & t) & "', TotalPaid = '" & request.form("tpaid" & t) & "' WHERE UserId = " & request.form("UserId" & t)
Conn.Execute strSQL
next
Conn.close
set Conn = Nothing
%>