Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically sort a table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00465022
Message ID:
00465039
Vues:
15
>Hi to All
>Does anyone know how to sort a table programmatically?
>More specifically:
>We need to sort the contents of a grid by date when the user initializes a form and when a change has been made (refresh).
>We have already tried doing the sort through the data environment for the table but it does not work .
>any recomendations?
>Thanking you in advance
>Regards
>mike


If you create a index on that field you can simply set the order to that index.
If you want to have it sorted in the table itself you can use the
sort to .. on ..
command.
Then you have to delete the original contents of the table.
If you have exclusive use of the table you can issue
zap
If not, you can issue
delete all
Then you can append from the temporary table you just sorted to.

PS. If you issue delete all to delete all the records in the table before append, make sure that you have no primary or candidate keys then, because you then have the same PK's twice. To avoid this you can try to replace the PK's first with another value, before you delete them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform