Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot delete stand alone idx
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
00964099
Message ID:
00964100
Vues:
9
Rex,

Try to close index using
SET INDEX TO
BTW, it's a bad idea to open tables in specific work areas or reference them by workarea number/letter. It makes code very hard to maintain and causes bugs which very hard to track down. You should open tables in the next available are and use alias to reference them. For example
SELECT 0 
 USE (mxfile4) ALIAS mxfile4 ORDER TAG numbers
...
SELECT mxfile4 
SET INDEX TO
>In my app, I open a table with a structural .cdx file as part of the startup sequence as:
>
USE (mxfile4) in 4 ORDER TAG numbers.
>
>However, if I add a temporary index for a specific reason
>
cFile = MXTEMPFILES + "temp.idx"
>INDEX ON recno + event + seqno + type + notation TO (cFile)
>then try to delete the temporary index later,
>
cFile = MXTEMPFILES + "temp.idx"
>IF FILE(cFile)
>   ERASE (cFile)
>ENDIF
>I get the 'File is in use' error.
>
>According to VFP help (Deleting an Index):
>"To delete a stand-alone .idx file, use the DELETE FILE Command. "
>
>The really strange thing is that VFP has added my temp idx index as a TAG to the table and even using
>
DELETE TAG temp in (cFile)
>won't delete the tag.
>
>It appears that I have to physically close the table to remove this temporary index.
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform