Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Backup simples sem OCX
Message
From
18/09/2002 09:45:06
 
 
To
18/09/2002 06:14:09
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00701674
Message ID:
00701753
Views:
17
Oi Pedro

>Queria uma pequena e simples rotina de backup , para ser incluida no meu EXE e assim ser distribuida nos clientes .
>
Esta rotina funciona disparada por um controle timer.. De tempos em tempos ela executa o seguinte:
procedure copiar
Dimension WFILES[10,6]
WTFDBF=ADIR(WFILES,"dbfs\*.*")
Thisformset.ix=thisformset.ix+1
if  thisformset.ix>WTFDBF
    Thisformset.form2.Timer1.enabled=.f.
    Thisformset.form2.Label1.caption=""
    Thisformset.form2.co1.Olescroll.width=(WTFDBF*301)/WTFDBF
    =thisformset.form2.release()
    return
endif
wperform=(thisformset.ix*100/WTFDBF)
wnma=SUBSTR(WFILES[thisformset.ix,1],1,AT(".",WFILES[Thisformset.ix,1])-1)
If  AT("\",wnma) > 0
    wnma=RIGHT(wnma,AT("\",wnma)+1)
Endif
Thisformset.carquivoatual=wnma
Thisformset.form2.co1.Olescroll.width=(thisformset.ix*301)/WTFDBF
Thisformset.form2.Label1.caption="Copiando: "+ThisFormset.carquivoatual
emarquivo=wnma
wkwork="BKP"+DTOS(DATE())
copy file ("dbfs\"+alltrim(WFILES[thisformset.ix,1]))to (wkwork)
If  thisformset.nerrosituacao=1
    If  thisformset.ix=WTFDBF
        Thisformset.form2.Timer1.enabled=.f.
        If  thisformset.nerrosituacao=1
            =thisformset.form2.release()
        Else
            Thisformset.form2.Label1.caption=""
        Endif
    Endif
else
    thisformset.nerrosituacao=1
Endif
endproc
Espero que ajude

Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Previous
Reply
Map
View

Click here to load this message in the networking platform