Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to tell if an index is damaged
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00477607
Message ID:
00477660
Vues:
29
Hi John.

>I was wondering if anyone knows of an easy way to tell (through code preferably) if an index is damaged.

There are two kinds of index damage: the kind that causes an error (or even a GPF) in VFP when the table is opened or when the index is updated (eg. adding a record), and the kind that doesn't cause an error but gives "goofy" results, like hitting the down arrow in a browse window and seeing the highlight jump to a record several lines *above* the one you're on.

For the first kind, have your error handler trap the various errors indicating index damage: 5, 19, 20, 23, 26, 112, 114, 1124, 1567, 1683, and 1707. The second kind, unfortunately, isn't trappable, and in my experience, a program to go through every record in the table and ensure its keys are in the index is too slow. If you suspect an index problem, it's just way faster to recreate the indexes.

Doug
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform