Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Backup simples sem OCX
Message
De
18/09/2002 09:45:06
 
 
À
18/09/2002 06:14:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00701674
Message ID:
00701753
Vues:
18
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform