Information générale
Catégorie:
Codage, syntaxe et commandes
Titre:
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
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