LOCAL cTempZip, cTempPath, cdia, m.drv
LOCAL oTherm, cThermometer
*-- Close forms
=fecha_forms()
*-- maio 2010 Close work areas
FOR i = 1 TO 100
SELECT(i)
use
ENDFOR
cTempZip=""
cTempPath=""
m.drv = m.driver+":"+m.diretor
cSource = ADDBS(m.drv) && This is data path
SET CENTURY on
cdia = DTOC(DATE())
cdia = SUBSTR(CDIA,1,2) + SUBSTR(CDIA,4,2) + SUBSTR(CDIA,7)
*--cDestination = m.drv+cdia+".bak"
cDestination = m.drv+cdia+".zip"
cTempZip = m.drv+'temp'+ '.zip'
cThermometer = 'gsThermometerBar'
oTherm = createobject(cThermometer)
oTherm.lblProgress.caption = "Backup dos dados da Livraria"
oTherm.Show()
DECLARE INTEGER Sleep IN kernel32 INTEGER
IF FILE(cTempZip)
DELETE FILE (cTempZip)
ENDIF
= STRTOFILE(CHR(80) + CHR(75) + CHR(5) + CHR(6) + REPLICATE(CHR(0),18),cTempZip)
DIMENSION aDBFs(1,5)
nCount = ADIR(aDBFs,cSource+"*.*")
oShell = CREATEOBJECT("Shell.Application")
FOR i = 1 TO nCount
oTherm.Progress1.Value = INT(i/nCount*100)
cFileName = aDBFs(i,1)
*-- IF UPPER(RIGHT(cFileName,3)) $ "DBF|FPT" AND NOT ("FOX" $ cFileName)
*-- Fev 2011: Salves .CDX also
IF UPPER(RIGHT(cFileName,3)) $ "DBF|FPT|CDX" AND NOT ("FOX" $ cFileName)
oTherm.lblProgress.caption = "Backup => "+ cFileName
cFile = cSource + cFileName
nCount1 = oShell.NameSpace(cTempZip).Items.Count
oShell.NameSpace(cTempZip).CopyHere(cFile)
DO WHILE oShell.NameSpace(cTempZip).Items.Count = nCount1
= Sleep(100)
ENDDO
ENDIF
ENDFOR
oTherm.Release
RELEASE oShell
COPY FILE (cTempZip) TO (cDestination)
DELETE FILE (cTempZip)
CLEAR DLLS
*-- Find where is the pen drive
IF DISKSPACE("E:\") = -1
IF DISKSPACE("F:\") = -1
IF DISKSPACE("G:\") = -1
IF DISKSPACE("H:\") = -1
MESSAGEBOX("Não há dispositivo de gravação (pen-drive) disponível para salvar os dados !",48,"Erro")
ELSE
lcdrive="H:\"
COPY FILE &cDestination TO &lcdrive
ENDIF
ELSE
lcdrive="G:\"
COPY FILE &cDestination TO &lcdrive
ENDIF
ELSE
lcdrive="F:\"
COPY FILE &cDestination TO &lcdrive
ENDIF
ELSE
lcdrive="E:\"
COPY FILE &cDestination TO &lcdrive
ENDIF
*-- Reabre as áreas fechadas para backup
*-- Some clean-up routines
*----------
=montadic()
*----------
*--- Monta os dicion rios de integridades
*----------
=mont_del()
=mont_atr()
*----------
* Ativa o Help
*******
Do Help
*******
*-- reativa toolbar
fotb = CREATEOBJECT("cls_toolbar")
fotb.show()
return
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.