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

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

Just a thought,

Tom

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;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.