How can I save all retrieved records from database at the same time?

MomyWerm

New Member
I have a wage calculation form that start from retrieving sum of wage from database and then, after user add some extra payment in order to calculate Net wage, save them back to database once again.My problem was my code is only work to save one record at a time. What I need was to be able to save all records at the same time. So could you please help me.\[code\]<%if Rs.eof then response.write "<tr><td colspan=""9"">&nbsp;" call displayNotFoundRecord response.write "</td></tr>"Else Do while Rs.AbsolutePage = strPageCurrent And Not Rs.EOF dim color y = n mod 2 if y > 0 then color = "EFF4FA" else color = "ffffff" end if if rs.fields.item("if_social_sec") = "True" then displaytxt = "" soc_sec_v = soc_sec else displaytxt = "none" soc_sec_v = 0 end if wage_v = rs.fields.item("Total") salary_v = rs.fields.item("lb_salary") if rs.fields.item("lb_type") = "perunit" then salary_wage = wage_v displaytxt_w = "readonly class=""bgdisable""" displaytxt_lb = "readonly class=""bgdisable""" else salary_wage = salary_v displaytxt_w = "" displaytxt_lb = "" end ifif_pm = request.form("if_pm")pm_pay = rs.fields.item("lb_pmPay") if if_pm <> "" then if_pm_v = pm_pay disable_txt_pm = "readonly" else if_pm_v = 0 disable_txt_pm = "readonly class=""bgdisable""" end if %><form name="myform2_<%=n%>" action="salary_action.asp" method="POST"><tr bgcolor="#<%=color%>"> <td class="btline difcursor" nowrap width="7%">&nbsp;<%=rs.fields.item("lb_name")%></td><td class="btline center" nowrap width="8%"><input type="text" name="working_day" id="working_day" value="http://stackoverflow.com/questions/12597333/<%=rs.fields.item("MaxOfdays")%>" size="7" <%=displaytxt_w%> onFocus="startCalc(this);" onBlur="stopCalc(this);"></td><td class="btline " nowrap width="10%"><input type="text" name="wage" id="wage" value="http://stackoverflow.com/questions/12597333/<%=salary_wage%>" onFocus="startCalc(this);" onBlur="stopCalc(this);"></td><td class="btline center" nowrap width="8%"><input type="text" name="OT" id="OT" size="7" value="http://stackoverflow.com/questions/12597333/<%=if_OT_v%>" onFocus="startCalc(this);" onBlur="stopCalc(this);" <%=disabled_ot%>></td><td class="btline center" nowrap width="6%" ><input type="text" name="OT_rate" id="OT_rate" size="5" value="http://stackoverflow.com/questions/12597333/<%=rs.fields.item("lbOT")%>" <%'=disabled_txt%> readonly class="bgdisable"></td><td class="btline center" nowrap width="6%" ><input type="text" name="OT_amt" id="OT_amt" size="5" value="" <%'=disabled_txt%> readonly class="bgdisable"></td><td class="btline center" nowrap width="8%" ><input type="text" name="soc_sec" id="soc_sec" size="7" value="http://stackoverflow.com/questions/12597333/<%=soc_sec_v%>" <%=disable_txt_soc%> onFocus="startCalc(this);" onBlur="stopCalc(this);"></td><td class="btline center" nowrap width="8%"><input type="text" name="pmPay" id="pmPay" size="7" value="http://stackoverflow.com/questions/12597333/<%=if_pm_v%>" onFocus="startCalc(this);" onBlur="stopCalc(this);" <%'=disable_txt_pm%> readonly class="bgdisable"></td><td class="btline" nowrap style="padding-left: 10px" width="8%" ><input type="text" name="ex_pay" id="ex_pay" size="7" onFocus="startCalc(this);" onBlur="stopCalc(this);"></td><td class="btline bold " width="10%"><input type="text" name="net_wage" id="net_wage" size="7" readonly class="bgdisable"><input type="hidden" name="lb_type" id="lb_type" size="7" value="http://stackoverflow.com/questions/12597333/<%=rs.fields.item("lb_type")%>"><input type="hidden" name="date_from" id="date_from" size="7" value="http://stackoverflow.com/questions/12597333/<%=date_from_txt%>"><input type="hidden" name="date_to" id="date_to" size="7" value="http://stackoverflow.com/questions/12597333/<%=date_to_txt%>"><input type="hidden" name="lb_id" id="lb_id" size="7" value="http://stackoverflow.com/questions/12597333/<%=rs.fields.item("lb_id")%>"><input type="hidden" value="http://stackoverflow.com/questions/12597333/N" name="edit_salary"></td><td class="btline"><input type="text" name="sar_note" value="" size="14"></td><td class="btline" > <input type="submit" value="http://stackoverflow.com/questions/12597333/Save1"></td></tr></form><% Rs.movenext n = n + 1 LoopEnd ifRs.closeset Rs=nothingCall DBConnClose()%><tr> <td colspan="12" align="center" style="padding:10px;"> <input type="submit" value="http://stackoverflow.com/questions/12597333/Save2"> </td></tr>\[/code\]What I need is to make "Save2" work. But right now only "Save1" that work.
 
Back
Top