Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Indexing unique
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00180757
Message ID:
00180779
Vues:
24
Tim,

Relax. RTFM. When you index UNIQUE, only the first record with the key value is in the index. If that record doesn't happen to match the criteria in your filter it won't show up. Maybe the problem is that you think that SET FILTER affects which records are indexed. It doesn't. You might want to try this:

inde on office to e:z uniq FOR 'CR_C' $ method .and. mbpac= allt(bpac)

You may want to look at another method alltogether. Unique indexes aren't maintained. You'll need to reindex each time you use the index. That might work in your situation, but if it won't you may want to look into other methods like a SQL SELECT statement.

>THIS IS CRAZY! Why do I need the filter off? It does work with the filter off but that defeats the purpose doesn't it?
>
>
>>Timothy,
>>
>>The VFP help says that the unique clause "specifies that only the first record encountered with a particular index key value is included in an .IDX file or a .CDX tag." Try your example without the filter. When you browse you should see one record per office. If none of those records meets your filter condition, that would explain why no records appear when you index UNIQUE and apply the filter.
>>
>>>in my example I have a dbf fields office,bpac,method & others where as there are 6 or so different values for office repeatedly. After I set the filter & index and browse, NO RECORDs show! As below
>>>
>>>mbpac='691999'
>>>use e:dbf
>>>set filt to 'CR_C' $ method .and. mbpac= allt(bpac)
>>>brow fiel method,bpac,office *ok so far
>>>inde on office to e:z uniq
>>>brow fiel method,bpac,office * no records show!
>>>Sounds crazy?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform