Click to See Complete Forum and Search --> : how to insert multiple row at once


adiel
07-23-2007, 04:31 AM
hi,
i'm developping a web application with an access database.

in my application there's a loop that gets values of a form
like:

<input name="pilih<%=bil%>" type="checkbox" >
<input type="hidden" name="getpilih<%=bil%>" value="<%= pa_nodaftar %>">

<td align="center" bgcolor="#FFFFCC"><font size="1">
<input type="text" name="txtCatatan" id="txtCatatan" maxlength="100" class="formx4">

<input type="hidden" name="bil" value="<%=bil%>">

when i press submit, data will insert at 2nd page.
SQL at 2nd like:

bil = request.QueryString("bil")
txtCatatan =desh(trim(request("txtCatatan")))

for x = 1 to bil
if request.QueryString("pilih"&x) = "on" then


sqlInsert ="insert into pa_kedatangan_pel(PA_NODAFTAR, PA_SESI, PA_SEMESTER, PA_KEDATANGAN, PA_TRKH, PA_CATATAN) values ('"&request.QueryString("getpilih"&x)&"','2007/2008','1','Y','"&trkhJumpa&"', '"&txtCatatanLec&"')"
cn.execute sqlInsert

end if


rite now, i can insert value 'Y' base on PA_NODAFTAR to PA_KEDATANGAN. but how can i insert txtCatatan base on PA_NADAFTAR to PA_CATATAN. PA_CATATAN will save a text that user has insert. i try using txtCatatanLec = Split(txtCatatan,", ") to split a commas but an unhandled data type was encountered.

any suggestions?