[Gambas-user] anybody have a parser

johnf jfabiani at ...1109...
Wed Feb 15 08:05:31 CET 2006


On Tuesday 14 February 2006 22:51, Rob Kudla wrote:
> On Wed February 15 2006 00:25, johnf wrote:
> > 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.
>
> Yeah, that's because DB.Quote (in gb.db.mysql, at least) seems to
> put the quoted string in backticks, so single quotes wouldn't
> hurt it.  Sticking backticks in your string, however, does cause
> DB.Quote to not work so well.  Same with putting in a newline.
> I'd call that a bug.
>
> I think that whatever algorithm is used in PHP's
> "mysql_real_escape_string" function is probably a better idea,
> but unfortunately I don't have time right now to add the missing
> quotable entities to gb.db.mysql (having never looked at that
> code before.)
>
> Rob
Again thanks.  BTW I'm using Postgres.  Another issue, is it possible to read 
the return string that database engine returns?  Like 

aVariant = connection.exec("update table set company = 'mystring' ;")

Will aVariant contain the response from the database engine?  Something like 
"Query returned successfully: 1 rows affected, 36 ms execution time."

John




More information about the User mailing list