delete by checkbox

This is a discussion on "delete by checkbox" within the Classic ASP section. This forum, and the thread "delete by checkbox are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Mar 28th, 2008, 11:04
New Member
Join Date: Mar 2008
Location: Spain
Age: 22
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
delete by checkbox

Hello, I would like delete records from my database with a checkbox. Show registration which is in my database and next would like a checkbox, and eliminate selected registration.
I am using this code I found in this forum but can not make it work, you can help me?
Code: Select all
<%
session("servidor")="********"
 
session("usuariobd")="*****"
 
session("contrasenabd")="******"
 
session("bd")="*******"
dim conexion
set conexion = Server.CreateObject("ADODB.Connection")
 
 
Dim pm, conn, rsCount
 
Set conn = Server.CreateObject("ADODB.Connection")
Set pm = Server.CreateObject("ADODB.Recordset") 
conn.Open = "driver={MySQL};server="&session("servidor")&";uid="&session("usuariobd")&";pwd="&session("contrasenabd")&";database="&session("bd")&""
Dim comment
 
For Each comment In Request("delete")
pm.Open "DELETE FROM usuario WHERE id = "& comment &"", conn,3,3
'Set pm = conn.Execute ("DELETE FROM userpm WHERE pmNo = "& comment &"") Can be done like this too, I don't have idea what is the different??
Next 
pm.Open "SELECT Nombre,Apellidos,Teléfono, Foto FROM usuario WHERE Nombre = '" & Session ("usuariobd") & "' ORDER BY id DESC", conn
'Set pm = conn.Execute ("DELETE FROM userpm WHERE pmNo = "& comment &"") Can be done like this too, I don't have idea what is the different??
 
 
%>
 
<input type="checkbox" name="delete" title="Select" value="<%=pm("id")%>">
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Mar 28th, 2008, 11:53
New Member
Join Date: Mar 2008
Location: UK
Age: 15
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: delete by checkbox

Are you experienced or could it be coded with php? If so i could help you here...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Mar 30th, 2008, 07:56
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,611
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: delete by checkbox

Can I have your full code please (your display page and all your database field name)
I will try to run them in my pc to test them!

Cheers...
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Mar 30th, 2008, 08:42
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,611
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Re: delete by checkbox

Quote:
Originally Posted by benracer View Post
Are you experienced or could it be coded with php? If so i could help you here...
He is in the ASP forum, so I guess he really need help in ASP not PHP
You know, if he have an account with window hosting, PHP will not work!

So, what error message did you get there FlashO?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] ASP-MySQL Delete By Checkbox Monie Classic ASP 1 Nov 10th, 2007 01:51


All times are GMT. The time now is 05:44.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42