Subject Re: [firebird-support] INSERT single quote in blob field
Author Martijn Tonies
Hi,

> User enter text in my program and I use a query like this to insert it
> into my firebird database
>
> INSERT INTO notesdossiers (idDossier, idGroupe, idEmploye, ladate, notes)
> VALUES(1, '0', 8, '06-06-2005', '" + theNote + "')
>
> it works well when theNote don't have any single quote in it, but if the
> user wrote single quote in is text, it doesn't work anymore.
> For example:
> theNote: I don't know why he called me back
>
> If it helps, the field is a BLOB field.

By far the best way to deal with dates and blobs and quotes is using
parameters.

If you don't use them, then check the QuotedString function in Delphi.

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com