Web Design and Development Forums

[SOLVED] ASP-MySQL Delete By Checkbox

This is a discussion on "[SOLVED] ASP-MySQL Delete By Checkbox" within the ASP Forum section. This forum, and the thread "[SOLVED] ASP-MySQL Delete By Checkbox are both part of the Program Your Website category.


Go Back   Webforumz.com > Program Your Website > ASP Forum

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Nov 10th, 2007, 00:57   #1 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
[SOLVED] ASP-MySQL Delete By Checkbox

Hai,

I manage to do/use this code with Access Database but ended up with this error when I use MySQL Database.

Code: Select all
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
ODBC driver does not support the requested properties.
/my-pm-inbox.asp, line 24
This is my code to delete by checkbox:
Code: Select all
    Dim connectionString, pm, conn, rsCount
    connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=monieweb; OPTION=4; UID=root; PASSWORD=monie;"
    Set conn = Server.CreateObject("ADODB.Connection")
    Set pm = Server.CreateObject("ADODB.Recordset") 
    conn.Open(connectionString)
   
    Dim comment
    For Each comment In Request("delete")
         pm.Open "DELETE * FROM userpm WHERE pmNo = "& comment &"", conn,3,3
    Next 
        pm.Open "SELECT * FROM userpm WHERE username = '"& user &"' ORDER BY pmNo DESC", conn
Code: Select all
<input type="checkbox" name="delete" title="Select" value="<%=pm("pmNo")%>">
This method of deleting using check box works marvelously if I use Access Database. How to twist this code for MySQL Database? Any idea?
__________________

Monie is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old Nov 10th, 2007, 01:51   #2 (permalink)
Most Reputable Member
 
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,567
Blog Entries: 2
Send a message via Yahoo to Monie
Re: ASP-MySQL Delete By Checkbox

I solved them myself, what a stupid error!

Code: Select all
    Dim connectionString, pm, conn, rsCount
    connectionString = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=monieweb; OPTION=4; UID=root; PASSWORD=monie;"
    Set conn = Server.CreateObject("ADODB.Connection")
    Set pm = Server.CreateObject("ADODB.Recordset") 
    conn.Open(connectionString)

    Dim comment
    For Each comment In Request("delete")
        pm.Open "DELETE FROM userpm WHERE pmNo = "& 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 * FROM userpm WHERE username = '" & Session ("name") & "' ORDER BY pmNo 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??
Error is in this line of SQL Statement:
Code: Select all
pm.Open "DELETE FROM userpm WHERE pmNo = "& comment &"", conn,3,3
throw away the '*' after the DELETE
__________________


Last edited by Monie; Nov 10th, 2007 at 01:56.
Monie is offline  
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
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

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
checkbox[] array into mysql... OUT? ppgpilot PHP Forum 1 Mar 13th, 2008 20:37
[SOLVED] Form Checkbox Validation Stuart PHP Forum 26 Nov 24th, 2007 23:39
[SOLVED] Automatic Checkbox/Radio Button Checking Stuart JavaScript Forum 8 Nov 9th, 2007 01:55
[SOLVED] Form to email with checkbox itsdesign PHP Forum 4 Oct 29th, 2007 00:57
A Solved Checkbox snow Webforumz Suggestions and Feedback 14 Sep 25th, 2007 20:11



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 13:33.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59