[Gambas-user] anybody have a parser

johnf jfabiani at ...1109...
Wed Feb 15 06:25:47 CET 2006


On Tuesday 14 February 2006 19:56, Rob Kudla wrote:
> On Tue February 14 2006 22:03, johnf wrote:
> > I need a parser to parse out the special characters for SQL
> > statements.  I.e. I need to replace " ' ", " ; ",  and other
> > special characters in "textarea" controls so that I can use
> > "Update" and "Insert" statements.  Actually, I should parse
> > all controls.
>
> The Connection.Exec method automatically quotes your parameters
> ("arguments" in gb.db parlance), but if you want to do it
> manually for some reason you can use Connection.Quote.
>
> http://www.gambasdoc.org/help/comp/gb.db/connection/exec
> http://www.gambasdoc.org/help/comp/gb.db/connection/quote
>
> Rob
Thanks for the response.  I'm using 1.9.24 and using "DB.Quote(textarea.Text)" 
does not work for me.  Just adding a " ' " (a single quote) to the text will 
cause the update statement to fail.  The single quote is not escaped 
correctly.  However, it does appear to work if the string is not multi-line.

John




More information about the User mailing list