943,779 Members | Top Members by Rank

Ad:
Oct 1st, 2008
0

Delphi sql delete

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
taineechan is offline Offline
17 posts
since Oct 2006
Oct 2nd, 2008
0

Re: Delphi sql delete

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

Just a thought,

Tom
Reputation Points: 10
Solved Threads: 1
Newbie Poster
espSquall is offline Offline
10 posts
since Sep 2008
Oct 2nd, 2008
1

Re: Delphi sql delete

[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;
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ennis is offline Offline
5 posts
since Apr 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Need help with Delphi code
Next Thread in Pascal and Delphi Forum Timeline: How to make GUI App using only .dpr file(without .pas, .dfm ..)?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC