Delphi sql delete

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2006
Posts: 17
Reputation: taineechan is an unknown quantity at this point 
Solved Threads: 1
taineechan's Avatar
taineechan taineechan is offline Offline
Newbie Poster

Delphi sql delete

 
0
  #1
Oct 1st, 2008
Hi All

I want to delete records from a table. I'm using the following query:

Pascal and Delphi Syntax (Toggle Plain Text)
  1. adqdelete.active := false;
  2. adqdelete.sql.add('delete from stalls');
  3. adqdelete.sql.add('where stall_name =');
  4. adqdelete.sql.add(edtDeleteStalls.Text);
  5. adqdelete.active:=True;

This gives a syntax error. does anyone know what I'm doing wrong?

Thanks for your time
Tai
try{ be yourself;}
catch(you suck){be someone else;}

//always be yourself:unless you suck
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 10
Reputation: espSquall is an unknown quantity at this point 
Solved Threads: 1
espSquall espSquall is offline Offline
Newbie Poster

Re: Delphi sql delete

 
0
  #2
Oct 2nd, 2008
I'm pretty new to SQL but shouldn't you add a ';' at the very end of the query?

Just a thought,

Tom
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 3
Reputation: ennis is an unknown quantity at this point 
Solved Threads: 0
ennis ennis is offline Offline
Newbie Poster

Re: Delphi sql delete

 
0
  #3
Oct 2nd, 2008
[QUOTE=taineechan;702787]Hi All

I want to delete records from a table. I'm using the following query:

Pascal and Delphi Syntax (Toggle Plain Text)
  1. adqdelete.active := false;
  2. adqdelete.sql.add('delete from stalls');
  3. adqdelete.sql.add('where stall_name =');
  4. adqdelete.sql.add(edtDeleteStalls.Text);
  5. adqdelete.active:=True;

adqdelete.active := false;
adqdelete.sql.clear;
adqdelete.sql.add('delete from stalls where stall_name = ' + quotedStr(edtDeleteStalls.Text));
adqdelete.active:=True;
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Pascal and Delphi Forum


Views: 1807 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Pascal and Delphi
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC