Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to know order() from select-sql
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00945631
Message ID:
00945668
Vues:
17
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform