Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's wrong with this SPT containing dates
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
Database:
MS SQL Server
Miscellaneous
Thread ID:
01134926
Message ID:
01136351
Views:
15
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform