Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know order() from select-sql
Message
 
To
24/09/2004 03:58:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00945631
Message ID:
00945668
Views:
22
>>i have a grid in my form where i want to order the recordsource (a cursor from select * drs into cursor csrdrs) when my user click on each column's header.

i want to know first in what oder is the column set, so i should be able to do an order by ascending or descending.>>

Hi Evelyn,

You can do this,

let say, you first issued this statement, select * drs into cursor csrdrs order by DATE Ascending, be it in load or init event...
lAsc = .T.
Now, let say your first grid column controlsource is bind to csrdrs.date, on you header click event, you can put this code
Select csrdrs
If lAsc
   Index on date to data\datedesc Descending
   lAsc = .F.
Else
   Index on date to data\dateasc Ascending
   lAsc = .T.
Endif
Thisform.grid1.refresh
You can do also same with other columns on your grid..
The index on command, you can store the temporary indexes to your temp folder. Its more easier than issuing another select statement against a table
Jojo R. dela Cuesta, B.Sc.
eConsultant, Programmer
Dalplus Technologies
http://www.dalplus.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform