954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Delphi sql delete

Hi All

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

adqdelete.active := false;
adqdelete.sql.add('delete from stalls');
adqdelete.sql.add('where stall_name =');
adqdelete.sql.add(edtDeleteStalls.Text);
adqdelete.active:=True;


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

Thanks for your time
Tai

taineechan
Newbie Poster
17 posts since Oct 2006
Reputation Points: 10
Solved Threads: 1
 

I'm pretty new to SQL but shouldn't you add a ';' at the very end of the query?

Just a thought,

Tom

espSquall
Newbie Poster
10 posts since Sep 2008
Reputation Points: 10
Solved Threads: 1
 

[QUOTE=taineechan;702787]Hi All

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

adqdelete.active := false;
adqdelete.sql.add('delete from stalls');
adqdelete.sql.add('where stall_name =');
adqdelete.sql.add(edtDeleteStalls.Text);
adqdelete.active:=True;


adqdelete.active := false;
adqdelete.sql.clear;
adqdelete.sql.add('delete from stalls where stall_name = ' + quotedStr(edtDeleteStalls.Text));
adqdelete.active:=True;

ennis
Newbie Poster
5 posts since Apr 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You