Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement