Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problems with Apostroph in variable!
Message
De
16/04/1999 11:10:44
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00209007
Message ID:
00209008
Vues:
25
>Hello,
>I'm using a variable in the WHERE clause of a SQL Statement. The variable looks like so:
>cMyVar = "ALLTRIM(MyTable.MyField) = '" + ALLTRIM(THIS.VALUE) + "'"
>
>Naturally, if MyTable.MyField contains an apostroph (like "De'Isle"), I get a syntax error :-(
>What do I have to do in this case?
>Thanks in advance for your help!

You may switch apsotroph and quotes:
cMyVar = 'ALLTRIM(MyTable.MyField) = "' + ALLTRIM(THIS.VALUE) + '"'
If it's not sufficient, you may use CHRTRAN() to get rid of apostrophes.
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform