General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only