[Gambas-user] Eroor when doing SQL

Rob sourceforge-raindog2 at ...94...
Fri Jun 18 16:53:53 CEST 2004


On Friday 18 June 2004 01:31, Tim Hanschen wrote:
>   SELECT album from mp3 where title = " & Chr(34) & title &
> Chr(34))


I always use single quotes when specifying strings in SQL 
queries.  This does mean that you'll need to use Replace() and 
replace all the single quotes with double single quotes in your 
field values, which any SQL server will convert back to single 
single quotes.  

Also, you can just backslash escape double quotes ("\"") in 
Gambas so that "Chr(34)" stuff is unnecessary.  Finally, there's 
an extra parenthesis at the end of that statement, though I bet 
it's from copying and pasting.

I have never run into the ampersand problem you describe, but 
I'll try to duplicate it.

Rob





More information about the User mailing list