General information
Category:
Coding, syntax & commands
Title:
File in Use Error #3
Using VFP7 sp1 & CodeMine 7.1. (Don't think this has anything to do with CM.)
Have a form that replaces some free tables with their backup copies. For 4 of the five tables this code works fine. The 5th blows with a Error#3 "File in use" when trying to Delete the table. Am using DataSession=1. Checked the open tables using ADIR() and it's not there. This code is identical in all five routines except for the table names.
All help appreciated. (I'm outa ideas.)
Here's the code:
lcTempFile = JUSTPATH(SYS(16,1))+"\data\identity.dbf"
lcTempCDX = JUSTPATH(SYS(16,1))+"\data\identity.cdx"
IF thisform.CheckFile(lcTempFile) && Does file exist?
lcFile1=m.lcDir+"\identity.DBF"
llReturn=thisform.FileInfo(lcFile1, lcTempFile) && Overwrite File?
IF NOT llReturn
RETURN .F.
ENDIF
IF USED("identity")
USE IN identity && closes the Table
ENDIF
DELETE FILE(lcTempFile) && File in Use Error #3
DELETE FILE(lcTempCDX) && File in Use Error #3
ENDIF
lcFile1=m.lcDir+"\identity.*"
lcFile2=JUSTPATH(SYS(16,1))+"\data\"
*WAIT WINDOW "XCOPY ["+lcFile1+"] ["+lcFile2+"]"
RUN xcopy.exe &lcFile1 &lcFile2
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