Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How Can a File Still be In Use after Close All
Message
De
15/10/2003 09:47:28
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How Can a File Still be In Use after Close All
Divers
Thread ID:
00838860
Message ID:
00838860
Vues:
70
The code below is a trivial routine to pack all the files in a given directory. It works fine on my own machine, but if I install the program on a remote machine it falls over telling me that one of the files is in use. Given the first line (close all), I am at a loss to understand how this is possible or what I can do about it, although, as you will see, I have attempted a bodge to trap it.

Any theories?

CODE SNIPPET
close all
numfiles=ADIR(myarray,'*.dbf')
SET SAFETY OFF
FOR ncount=1 TO numfiles
filename=TRIM(myarray(ncount,1)) && renamed array - third attempt
IF USED(filename)
&& set bodge ON. This should never happen because we closed ALL above
&& but happens anyway in remote compiled version. Bodge off
USE IN (filename) && this doesn't work either!
endif
USE (filename) EXCLUSIVE
WAIT WINDOW 'Removing Deleted Records from '+filename nowait
pack
ENDFOR
wait clear
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform