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:
00655505
Views:
25
>>Sergey,
>>
>>I soon ran into another similar problem. If the text includes double quotes, for example I have to transfer text strings where double quotes are included for the indication of the measuring unit inch, then the UPDATE – SQL command does not work. For example lprFieldValue = "1/2"x2" Hex headbolt" gives the VFP error "Function name is missing )". I have tried several way of mixing apostrophe and double quote combinations but with no success. Do you have any idea to resolve my problem?
>
>Try to use square bracets as string delimiters and build update string insead of using macro substitution.
lprFieldValue = [1/2"x2" Hex headbolt]
>lcUpdateStr = [UPDATE MYSQLTABLE SET ] + lprFieldName + [='] + [lprFieldValue] + [']
>nUpdate=SQLEXEC(nCon, lcUpdateStr)
Ooops. It should be
lprFieldValue = [1/2"x2" Hex headbolt]
lcUpdateStr = [UPDATE MYSQLTABLE SET ] + lprFieldName + [='] + lprFieldValue + [']
nUpdate=SQLEXEC(nCon, lcUpdateStr)
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform