Discussion:
Save '
(too old to reply)
news.microsoft.com
2006-04-12 00:54:28 UTC
Permalink
str = "Length 5.5' x 5.8'"

Cannot save str variable to SQL server database through SQLEXEC()
I know the problem is caused by ', what should I do?

Thank!
Jack Jackson
2006-04-12 04:47:48 UTC
Permalink
On Wed, 12 Apr 2006 08:54:28 +0800, "news.microsoft.com"
Post by news.microsoft.com
str = "Length 5.5' x 5.8'"
Cannot save str variable to SQL server database through SQLEXEC()
I know the problem is caused by ', what should I do?
Thank!
Replace the single quote with two single quotes.

str = "Length 5.5' x 5.8'"
cSQL = [INSERT INTO tbl (fld) VALUES('] + ;
STRTRAN(str, ['], ['']) + [')]
SQLEXEC(nHandle, cSQL)

Loading...