SunQuest
           ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old September 18th, 2003, 09:03 AM
gintom gintom is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Essex, UK
Posts: 164 gintom User rank is Private First Class (20 - 50 Reputation Level)gintom User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 17 h 16 m 46 sec
Reputation Power: 5
deleting from database using checkboxes

I have a MS Access Database. I have a page where i do a search for a item by date, I select a date and then all the information from the database that i requested appears.

From all the information that appears I want to be able to tick the ones that I want to delete or a select all button and click delete and all the ones that where ticked will be deleted from the database.

Any help will be greatly appreciated.

-Tom

Reply With Quote
  #2  
Old September 18th, 2003, 10:38 PM
icepricessa's Avatar
icepricessa icepricessa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 199 icepricessa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 10 m 38 sec
Reputation Power: 5
u could use javascript for the checking all or one checkbox here
http://javascript.internet.com

and as for the asp code one checkboes.. here's a tutorial abt checkbosxes that i found useful
http://www.asp101.com/samples/checkbox.asp

hope it helps

Reply With Quote
  #3  
Old September 18th, 2003, 10:41 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 22 sec
Reputation Power: 6
Send a message via AIM to unatratnag
Give this a shot.

When you print the checkboxes out to the screen, give them the value of the primary key of that row.

have the page submit to itself. If all is checked, delete * from database.

otherwise, do a loop through each of the checkboxes, if it's checked, then add that line into the delete SQL statement

Reply With Quote
  #4  
Old September 18th, 2003, 10:41 PM
Chris_Gilbert Chris_Gilbert is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: London
Posts: 166 Chris_Gilbert User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 2 h 32 m 5 sec
Reputation Power: 6
Either hardcode the checkbox variables so that when you want to delete the email address for instance, by clicking the checkbox the variable is the access field name. i.e. the checkbox variable is email and the field name inside Access iis also email, then use this variable in your SQL query. This is best if its just a particular field in a recordset that you want to delete.

If you want to delete an entire record, give each checkbox the unique ID that relates to that record. Then when you check the box the variable that you catch in the response.querystring or response.form will relate to that record.


Both ways are essentially the same but one assigns the field variable and the other the unique ID for that record. I'm not sure whether you want to delete *some* of a particular records data i.e. delete the email address but keep the users details or whether you are trying to delete the entire record

Hope this helps and that i haven't just confused you even more.
__________________
Thanks in advance

Chris

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > deleting from database using checkboxes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway