Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot delete stand alone idx
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00964099
Message ID:
00964100
Views:
10
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform