By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,059 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

updating multiple records via online form

P: n/a
Hello,
I have a database generated form that I would like users to be able to
update by selecting a checkbox. Say the page displayed has six records
on it and the user wants to delete one or more of the records. They
would click the checkbox and hit a "delete" button. Then the database
would be updated and the user redirected back to the page that would
now show all the records that weren't deleted. Sort of like Yahoo
mail, you get a list of all the bulk mail, select the ones that you
want to delete, hit a delete button, and the page is updated to show
what e-mail is left. How do I do this using ASP?
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
1) Display the page with checkboxes
<input type=checkbox name="RecordsToDelete"
value="<%=RS.Fields("RecordPrimaryKey")">
2) When the form is posted back, take the comma separated string of records
to delete
Request.Form("RecordsToDelete")
and split them into an array
3) take the array and issue a delete command to the database
"DELETE FROM TableX WHERE RecordPrimaryKey=" & arr(i)
"dukeofwhelmsley" <du*************@yahoo.com> wrote in message
news:9d*************************@posting.google.co m...
Hello,
I have a database generated form that I would like users to be able to
update by selecting a checkbox. Say the page displayed has six records
on it and the user wants to delete one or more of the records. They
would click the checkbox and hit a "delete" button. Then the database
would be updated and the user redirected back to the page that would
now show all the records that weren't deleted. Sort of like Yahoo
mail, you get a list of all the bulk mail, select the ones that you
want to delete, hit a delete button, and the page is updated to show
what e-mail is left. How do I do this using ASP?

Jul 19 '05 #2

P: n/a
"DELETE FROM TableX WHERE RecordPrimaryKey IN (" &
Request.Form("RecordsToDelete") & ")"

"dlbjr" <dl***@dontknow.doyou> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Why not just do this

DELETE FROM TableX WHERE RecordPrimaryKey IN (RS.Fields("RecordPrimaryKey"))

dlbjr

Unambit from meager knowledge of inane others,
engender uncharted sagacity.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.