LucieLastic
Programmer
hi All
Having a bit of trouble saving strings to a database that contain apostrophies. The strings are read from a TEdit and a TMemo.
I'm writing the sql at runtime, eg
sql.add('Insert into Blah values ('''+Edit1.Caption+''')');
This fails with 'unterminated string' if the Caption has an apostrophy in it.
How can I get round this ?
I've also tried
sql.add('Insert into Blah values ("'+Edit1.Caption+'"');
but same problem.
I'm using Sybase.
lou
Having a bit of trouble saving strings to a database that contain apostrophies. The strings are read from a TEdit and a TMemo.
I'm writing the sql at runtime, eg
sql.add('Insert into Blah values ('''+Edit1.Caption+''')');
This fails with 'unterminated string' if the Caption has an apostrophy in it.
How can I get round this ?
I've also tried
sql.add('Insert into Blah values ("'+Edit1.Caption+'"');
but same problem.
I'm using Sybase.
lou