General information
Category:
Coding, syntax & commands
I am trying to get the following SQL Insert to run from VFP9 into a SQL Server table. Normally this runs, but when a value contains an ' mark in the data, the SQLEXEC() fails.
In the following example, the lcCompany var contains "PAUL'S INDUSTRIES INC" which causes the SQLEXEC() to fail. If the value was "PAULS INDUSTRIES INC" without the ', the insert would work.
***My example.
myconn = SQLCONNECT('mydsn', 'mydata', 'mypwd')
lcCompany = [PAUL'S INDUSTRIES INC]
lcName = [Paul Smith]
lcsql = [INSERT INTO mytable (company, name) VALUES ('] + lcCompamy + [', '] + lcName + [')]
=SQLEXEC(myconn, lcsql, '')
**********************************
How can I get this to work properly?
Thanks,
Jerry
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only