Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Function SEEK()
Message
De
18/01/2000 10:10:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
18/01/2000 07:04:38
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00319354
Message ID:
00319431
Vues:
11
>Hi alls
>I have a simple table.
>It has three fields: Name, Last Name and DNI and three common index; one with name other with last name and one with name+last name.
>
>When I make the search for name, It´s Ok.
>When I make the search for last name. It´s Ok.
>
>... But when I choice the compound index (name+lastname) and make a search it doesn´t work.
>
>What could be happening..???
>
>I consider the spaces mades for the texbox, for it I use Alltrim().
>
>TIA


Andrews,
If your index is just like you wrote (name+lastname) then trimming is likely to kill your search. ie: if name and lastname are 10, 15 in length "John", "Brown" would be stored in index "John Brown ". Spaces before "Brown" are needed for a successfull search (if lastname specified).
Use a seek expression like this :

lcExpr = padr(m.name,fsize("name","mytable"))+;
padr(m.lastname,fsize("lastname","mytable"))
?seek(lcExpr,"myTable","myCombinedTag")

This makes an "exact" search. If you trim lastname part then you'd be making a search based on current state of "set exact".
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform