>Hi Borislav
>
>>You could put comments as many as you wish, but don't use VFP comments chars [* or &&] use SQL Server ones [-- or /* */]
>>Something like:
>>
>>TEXT TO cVar NOSHOW
>> SELECT MyField, -- This is the first field
>> SecondField -- SecondSelected field
>> FROM MyTable /* This is the table */
>>ENDTEXT
>>SQLEXEC(.....)
>>
>
>Didn't seem to work. I have tried to paste the query in SQL Query analyser and it would work. But the same (ie. with comments with -- in it) will not work from VFP. Worked only after I removed, unfortunately with the time limitations I couldn't test which one, all the comments.
What error you get?
Here what works on my computer:
CLEAR
sqlH = SQLSTRINGCONNECT([.......;DataBase=master])
IF sqlH > 0
TEXT TO lctext NOSHOW
SELECT Type, -- This is TYPE Field
Name -- This is Name Field
FROM dbo.spt_values /*This is Table Name*/
ENDTEXT
IF SQLEXEC(sqlH, lcText) < 0
AERROR(la)
MESSAGEBOX(la[2])
ELSE
BROWSE NORMAL
ENDIF
ELSE
AERROR(la)
MESSAGEBOX(la[2])
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.