[Gambas-user] DB.Quote() doesn't quotes apostrophes

John Spikowski support at ...2529...
Mon Jan 23 06:03:46 CET 2012


On Mon, 2012-01-23 at 00:15 +0100, M. Cs. wrote:
> I have a dinamically created query text. I don't know the number of
> parameters passed to the DB.Exec, so I cannot use &1,&2,... form. I
> need to use the DB.Quote()
> My problem is: If I have a string
> mystring="Blackmore's Night",
> the DB.Quote(mystring) won't quote the ', so the query will crash. In
> fact I'm getting query string
> SELECT * FROM CATALOGS WHERE VName='Blackmore's Night'....
> It occurs with sqlite database.
> Is there any solution for that?

In MySQL there is a function to escape your data before doing and
INSERT/UPDATE. If the quote is the only issue, then use
VName='Blackmore''s Night'





More information about the User mailing list