>VFP6 SP5. Using sqlexec() to insert records into SQL server database. How to allow "'" or quotes to be entered?
>The syntax use is :-
>lcsqlstring = "Something with ' "
>Thanks in advance.
>Yau
Yau,
To pass a single quote to SQL server you've to type it twice. ie:
lcsqlstring = "Something with '' "
if you're doing it like:
SQLExec(handle, "insert into myTable (myField) values ('"+lcString+"')")
But there is a simplier way:
lcsqlstring = "Something with ' " && as you do already
SQLExec(handle, "insert into myTable (myField) values (?m.lcString)")
Cetin