>h=sqlstringconnect("your connect string here") >LOCAL lcVar >lcVar = "-- is this a proper comment?" >?sqlexec(h, ?m.lcVar, "none") >>
?sqlexec(h, "?m.lcVar", "none")but that's not what I had in mind. It creates code where it declares @p1 as string, assigns it whatever value there was (the value of lcVar, in this case), and then replaces the all instance of ?lcVar with @p1 in the text - which now consists of just that variable, and I get
*-- TEXT BLOCK BEGIN TEXT TO lcVar NOSHOW TEXTMERGE select * from table1 -- do we want a 2nd table here? select * from table2 ENDTEXT *-- TEXT BLOCK END nRet=sqlexec(h, lcVar, "doh")This is a perfectly legal SQL statement, which would pass muster in QA, but not in VFP, because the oddball question mark at the end of a line, not followed immediately by a variable name, confuses the parser.