Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - deleting  selected items from using asp
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

deleting selected items from using asp

 Post Reply Post Reply
Author
trickstar View Drop Down
Newbie
Newbie
Avatar

Joined: 12 August 2007
Location: New Zealand
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote trickstar Quote  Post ReplyReply Direct Link To This Post Topic: deleting selected items from using asp
    Posted: 12 August 2007 at 8:46pm
At present users are able to select one to delete by clicking on ID number which is passed on for deleting, users have to do this one at a time.
I want users to be able to select database record/s using check boxes to delete from database.
I am new to asp and need some help.
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2007 at 6:02pm
you can do it by having the checkbox to  all have the same name

this will make the IDs look like so

1,2,3,4,5

you can then split the string up like so:


strCheckbox = Request.Form("checkbox")
strAryWords = Split(strCheckbox, ",")
Dim iLoop
For iLoop = 0 to Ubound(strAryWords)
strSQL = "DELETE FROM table WHERE id = " &

strAryWords(iLoop)"
conn.execute()

Next


it could be buggy as i did it off the top of my head - so you might want to test it out a bit
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
trickstar View Drop Down
Newbie
Newbie
Avatar

Joined: 12 August 2007
Location: New Zealand
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote trickstar Quote  Post ReplyReply Direct Link To This Post Posted: 15 August 2007 at 12:30am
Thanks. I'll give it a go.
Back to Top
Scotty32 View Drop Down
Moderator Group
Moderator Group


Joined: 30 November 2002
Location: Manchester, UK
Status: Offline
Points: 1682
Post Options Post Options   Thanks (0) Thanks(0)   Quote Scotty32 Quote  Post ReplyReply Direct Link To This Post Posted: 15 August 2007 at 8:11pm
it appears i made a tiny typo in the SQL statement, either delete the quote after strAryWords(iLoop) or change it to:

strAryWords(iLoop) & ""
S2H.co.uk - WebWiz Mods and Skins

For support on my mods + skins, please use my forum.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.