Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with Apostroph in variable!
Message
From
16/04/1999 11:10:44
 
 
To
16/04/1999 11:07:51
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00209007
Message ID:
00209008
Views:
26
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform