Board index » delphi » Non Data-Aware Control

Non Data-Aware Control

Hi, I need help on how to use some non Data-Aware control to insert. I
use SQL7.0 and Delphi 4.0

Two data fields: Yes_no, datatype = bit and description, datatype =
text;

edit.text = 'Yes'; ---- for Yes-no field
Memo object for description field. There is a lot of single quotes and
double quotes in the memo text.

I do not know how to handle these single quotes and double quotes and
how to set the bit value in the sql statement.

sql.add('insert into table1');
sql.add('(Yes_no, description)');
sql.add('values (?....)');

Thanks for any help.

Chen

 

Re:Non Data-Aware Control


Can't you use something like this:

sql.add('insert into table1');
sql.add('(Yes_no, description)');
sql.add('values (:Yes_no, :description)');

ABoolean := edit.Text = 'Yes';
ParamByName('Yes_no').AsBoolean := ABoolean;
ParamByName('description').AsString := Memo.Text;

Quote
Chen <czc...@ucsd.edu> wrote:
>Hi, I need help on how to use some non Data-Aware control to insert. I
>use SQL7.0 and Delphi 4.0

>Two data fields: Yes_no, datatype = bit and description, datatype =
>text;

>edit.text = 'Yes'; ---- for Yes-no field
>Memo object for description field. There is a lot of single quotes and
>double quotes in the memo text.

>I do not know how to handle these single quotes and double quotes and
>how to set the bit value in the sql statement.

>sql.add('insert into table1');
>sql.add('(Yes_no, description)');
>sql.add('values (?....)');

>Thanks for any help.

>Chen

Other Threads