Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Searching all fields in a database
Message
De
15/11/1996 01:28:46
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00012278
Message ID:
00012316
Vues:
38
>
>MyString=create_string('m.field1','m.field2',etc...)
>
>IF .NOT. EMPTY(MyString)
> SELECT * FROM my_table ;
> WHERE &MyString ;
> INTO CURSOR MyCursor
>ELSE
> =msgbox('Invalid Criteria',"",16)
> RETURN
>ENDIF
> Example, if m.field1='Orange' and m.field is empty and
>m.field3=4, create_string will return me this:
>
>ALLTRIM(UPPER('Orange')) $ ALLTRIM(UPPER(field1)) ;
>.AND. 4=field3
>

...Yep, that's what I started with too, until I discovered that
there is a limitation of the compillation string. Imagine
having more than 15 fields to search for :) IT WILL NOT
COMPILE!!! That's why I suggested to go the SEEK-route.
More efficient search, can be controlled by SET NEAR ON/OFF...
Let's say after unsuccessful search, if you want to terminate
it to pick up a range of values, and than go for precise
matching, etc...
Some things are better be left unknown...NOT!!!
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform