Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
How Can a File Still be In Use after Close All
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
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