Information générale
Catégorie:
COM/DCOM et OLE Automation
Titre:
Word seems to cause Adir failure...
Hi All,
In my application the end user has the ability to view a file in Word..Then when exiting I create an automatic backup to 1 of 7 directories based on where he last backup to. code is below. When they exit if they have opened word the backup fails with an file open error on whatever the first file is that Adir returns. Can you help? Thanks in Advance.
Cecil...
use ..\data\sysprefs
nBack=sysprefs.lastbackup +1
if nBack < 7
repl sysprefs.lastbackup with nBack
else
repl sysprefs.lastbackup with 0
endif
messagebox("Backing up data please wait",64,"Back Up")
cBack="\frontsol\backup\"+ltrim(str(nBack))+"\" && \frontsol\backup\1, \frontsol\backup\2 etc...
*!clf!* New routine for backups...
nDbfs = Adir(aDbfs,"..\data\*.dbf")
close databases all && Close all open databases
close tables all && Close all open tables
clear
for i = 1 to nDbfs
cFile = aDbfs(i,1)
@ 14,10 say "Backing up "+ left(cFile+space(25),25)
cFile2 = "..\data\"+cFile
use (cFile2) in 0 exclusive
nRec = Reccount()
@ 15,10 say "Creating "+ left(cBack+cFile+space(50),50)
copy to (cBack+cFile)
use (cBack+cFile)
if reccount()<>nrec
@ 16,10 say 'Error in table '+cFile
endif
use
endfor
*!clf!* Will finally back it up...
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