Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Pass Through
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
00953544
Message ID:
00953550
Views:
10
>Hi All,
>
>Can I include the ORDER BY clause in my command when using SPT ?
>When I try to execute this command using SPT I am getting "Command contains unrecogized command/phrase" error.When I run it without the ORDER By clause it runs ok.
>
>lcCommand="SELECT cbudid, cacctid, cdescript, ccode, ncpdamt1, ncpdamt2, ncpdamt3, ncpdamt4, ncpdamt5, ncpdamt6, ncpdamt7, ncpdamt8, ncpdamt9, ncpdamt10, ncpdamt11, ncpdamt12, total, cid FROM bdgt01 WHERE cacctid IN(SELECT cacctid FROM dbo.glacct_cp WHERE lbudget=1) ORDER BY cacctid, cbudid, ccode"
>

Hi Daniel,

I don't see anything wrong with select itself. If there was, you would get an ODBC error not VFP error. The error message indicates that error is in your VFP code. The lenght of a string literal in VFP is limited to 255 charcters.

Btw, how can you debug code that you cannot even read w/o endless scrolling? Ii's bettere to use TextMerge to make code readable and avoid a string literal lenght limitation.
TEXT TO lcCommand TEXTMEGE NOSHOW
SELECT cbudid, cacctid, cdescript, ccode, ncpdamt1, ncpdamt2, 
		ncpdamt3, ncpdamt4, ncpdamt5, ncpdamt6, ncpdamt7, ncpdamt8, 
		ncpdamt9, ncpdamt10, ncpdamt11, ncpdamt12, total, cid 
	FROM bdgt01 
	WHERE cacctid IN (SELECT cacctid FROM dbo.glacct_cp WHERE lbudget=1) 
	ORDER BY cacctid, cbudid, ccode
ENDTEXT
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform