Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem to use apostrophe in a text string when using UP
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00654499
Message ID:
00654515
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
>Hi SQL friends,
>
>I have probably a simple problem I hope someone can explain. The problem is as follows:
>From VFP I send data to different SQL tables without any problem but, how do I do to update a field in a SQL database table if I which to include a apostrophe in my text string. For example: nUpdate=SQLEXEC(nCon,"UPDATE MYSQLTABLE SET &lprFieldName='&lprFieldValue' WHERE FIELDEXAMPLE=?nMynr") works for all text strings but not for lprFieldValue="This is the company’s property”. If the string would be written ="This is the companys property”, there is no problem.

Try to double apostrophes in the string.
lprFieldValue = STRTRAN([This is the company's property], ['], [''])
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform