Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to upload a single quote
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00724948
Message ID:
00724952
Views:
25
This message has been marked as the solution to the initial question of the thread.
*&  e.g
m.Company = strtran(m.Company, ['], [''])
HTH.

>Here is some FoxPro code:
>
>m.cSQLQuery = "UPDATE Distributor SET" + ;
> " last_name = '" + ALLTRIM(EVALUATE('m.last_name')) + "'" + ;
> " ,first_name = '" + ALLTRIM(EVALUATE('m.first_name')) + "'" + ;
> " ,middle_name = '" + ALLTRIM(EVALUATE('m.middle_name')) + "'" + ;
> " ,company_name = '" + ALLTRIM(EVALUATE('m.company_name')) + "'" + ;
> " WHERE dar = '" + EVALUATE('m.dar') + "'"
>m.nResult = SQLEXEC(m.nConnHandle, m.cSQLQuery)
>

>
>This is the value of m.cSQLQuery after this code (of course word wrapped
>for readability)
>
>UPDATE Distributor SET last_name = 'GALLANT' ,
> first_name = 'DARYL' , middle_name = '' ,
> company_name = 'TWO G'S INC.'
> WHERE dar = '1261'
>

>
>The SQLEXEC fails becase of company_name. What can I do to get this command to work and still have company_name contain the single quote?
>
>I'm using VFP 6, SQLEXEC executing against SQL Server 7.0.Any ideas greatly appreciated.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform