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 October 2nd, 2003, 09:05 PM
o1webdawg o1webdawg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 9 o1webdawg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
delete worked with access and doesnt with mysql

Hello

I wrote a line to delete from a record from access and it did. But I had to convert to mysql because of my host. Now I get this error on the page. I worked this for a while and am hoping someone has a fix.
______________________________________________
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[MySQL][ODBC 3.51 Driver][mysqld-4.0.15-nt]You have an error
in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use

near 'WHERE id = 41 and sendto = score' at line 1
/mattaweber/login/messagedelete_clients.asp, line 11


__________________________________________________
Here is the problem code

<%
Dim messageid,username,rsMessage

username = Session("username")
messageid = Request.QueryString("messageid")

set rsMessage = Con.Execute("DELETE From messages.* WHERE id = "&messageid&" and sendto = "&username&"")

Con.close
set Con = nothing

Response.Redirect("Clients_inbox.asp")
%>

line11 is this: set rsMessage = Con.Execute("DELETE From messages.* WHERE id = "&messageid&" and sendto = "&username&"")

PS -- I tried this already with single quotes around the id and username


Thanks for any help.

Reply With Quote
  #2  
Old October 2nd, 2003, 09:25 PM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 5
try this
Code:
set rsMessage = Con.Execute("DELETE From messages WHERE id = "&messageid&" and sendto = '"&username&"'") 

Last edited by pda8333 : October 3rd, 2003 at 12:06 AM.

Reply With Quote
  #3  
Old October 2nd, 2003, 10:35 PM
o1webdawg o1webdawg is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 9 o1webdawg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
It worked almost exactly like you said -- I just had to add ' ' on username.

set rsMessage = Con.Execute("DELETE From messages WHERE id = "&messageid&" and sendto = '"&username&"'")


I struggled over this line for hours and hours and you fixed it 30 minutes after I posted. Thank you so much. That was the last error in my website. Launch time!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Reply With Quote
  #4  
Old October 3rd, 2003, 12:07 AM
pda8333 pda8333 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 216 pda8333 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 6 m 31 sec
Reputation Power: 5
glad to help. we do mistakes all the time.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > delete worked with access and doesnt with mysql


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 1 hosted by Hostway