[Gambas-user] Eroor when doing SQL

Brant Wells bwells at ...475...
Fri Jun 18 14:43:51 CEST 2004


Hey Tim:

It has been my experience with mySql that the & sign causes problems 
when it's by itself.... For example if the title = 'Brant & Tim'  then 
it would fail...   So change the string to 'Brant && Tim'  (note I used 
two &'s)...

But try this first... Instead of using chr(34)...  Try chr(39) (the ' 
)...  I know M$ SQL Server is not too big on which one you use, but I 
forget if MySQL is picky about it or not... 

HTH,
~Brant


Tim Hanschen wrote:

>I am still trying.... it seems that the exec to the database fails....
>
>This is what I do:
>
>    rResult = Fhoeren.hDB.Exec("SELECT album from mp3 where title = " & Chr(34) & titel & Chr(34))
>
>Is it possible that the Exec interprets the &-sign as a string concatination?
>
>regards,
>  - Tim -
>
>
>
>
>gambas-user at lists.sourceforge.net schrieb am 18.06.04 07:32:51:
>
>Hi,
>
>I want to execute an SQL to a MySQL database, but it results in an error:
>
>
>  SELECT album from mp3 where title = " & Chr(34) & title & Chr(34))
>
>It works fine... mostly, but when the titel contains an "&" the SQL fails. When I send the command directly to the MySQL, I mean from an MySQL-commandine, everything is fine.
>
>What dows GAMBAS do with the "&" ??? How can I send SQL-commands that contains the "&"?
>
>regards,
>  Tim
>
>
>_____________________________________________________________________
>Wenn Worte allein nicht ausreichen: WEB.DE Video-Mail - 
>Die E-Mail der nachsten Generation! http://freemail.web.de/?mc=021197
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
>Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
>Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
>REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
>_______________________________________________
>Gambas-user mailing list
>Gambas-user at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
>__________________________________________________________________
>Zeigen Sie Emotionen mit der WEB.DE Bild-SMS! Das Bild ist gratis,
>Sie bezahlen nur den Versand. http://freemail.web.de/?mc=021196
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
>Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
>Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
>REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
>_______________________________________________
>Gambas-user mailing list
>Gambas-user at lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>  
>





More information about the User mailing list