Re: trie dynamique

Posté par ChtiCok le 19/9/2005 15:52:07
pourquoi a ce moment la ne pas passer par une requete qui se construit automatiquement avec les informations qu'a saisi l'utilisateur :

Exemple :

L'utilisateur sélectionne les champs nom, prénom et ville pour faire son tri :

tu construit la requete comme suit :

POUR i=1 A NbChampsSelect

SI i=1 ALORS
txtChamps+={"Champ"+i}
SINON
txtChamps+=","+{Champ"+i}
FIN
FIN

POUR i=1 A NbTriSelect

SI i=1 ALORS
txtTypeTri+="ORDER BY "+ {"Champ"+i}
SINON
txtTypeTri+=","+{"Champ"+i}
FIN
FIN

SQL="Select "+txtChamps+"FROM NOMTABLE"+txtTypeTri

Voila ta requete est construite et apres tu construis ton etat en parcourant ta requete

Cette contribution était de : http://old.wdforge.org/newbb/viewtopic.php?forum=14&topic_id=2744&post_id=11550