Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding Indexes
Message
 
À
14/01/2002 11:50:03
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00604368
Message ID:
00604566
Vues:
28
>Can you elaborate?

Jeffrey,

Looking at the other replies, or I didn't understand, or possibly the others didn't;
I'd say you are looking for the index-files belonging to the tables. So :

I suppose(d) you wanted to have all the tables indexed again;
Now have some naming for both type of files (dbf, cdx) which allow for the derival of both of them. When you have a table named SalesOrders, have a belonging index SalesOrders_CDX; whether you are scanning the tables or the indexes doesn't matter, each type will lead to the other.

You may want to do two things now :
1. Just ReIndex;
2. Build the Index from scratch.

Note carefully that both are different, already for physical reasons. Hence, the ReIndex will to one index only (the current), and will rather mess up things in the physical file. IOW, it doesn't help so much for speed. That is, which the CDX (I don't suppose you'll be using IDX).

Nr.2 two can be approached in two ways :
a. Have a program that contains all the index definitions;
b. Derive the current index definitions from the index files themselves.

I'd prefer a. because it looks more decent, and when something goes wrong (CDX has dissapeared for whatever reason), you can rebuild the index always.
However, b. can be done obviously by means of first opening the table including index, and scan the SYS(14,n) until empty. Store the found Index Expressions in an array, and Index On from that (after deleting the CDX). You will know the location of the CDXes I suppose, but when not, =CDX(n) will tell you (the index files could be found via a path, so you did not know it's location in advance).

The frequent xecuting of the procedure is something else, and I guess you have a solution for that. Obviously this can be done with some observer-like routine and a Timer. I'd run this in the background when possible, like a WTS (Citrix) task.

I hope this is what you meant.
Peter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform