Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Restoring deleted records
Message
De
21/02/2006 19:29:31
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
21/02/2006 16:29:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01097592
Message ID:
01097992
Vues:
11
At last somebody with an open mind:) OK I might not be an open minded one but at least I can see what the code does and warn you:do not trust this code:) FchSize() behavior is not as it was anymore. Try under different OS.
Cetin

>>Hi Fred, Thank you. Maybe i could be wrong.
>
>>Hi John. I believe a PACK makes a copy of the original table but without >the records marked for deletion. Then deletes the original table and >renames the new table to the original name. If so, then a file undelete >program could theoretically recover the deleted file providing the disk >space has not been used for other purposes in the meantime.
>
>Jos, AT Least, somebody with open mind, yes theoretically if no process have writed the sector of packed file it can be restored. I found the next code on my old downloads, its called unzap, it supposed to recover all zapped records, i was testing it but something is wrong.
>I put this code here, i don't know who is the owner but, i'm sure it was totally free when i found it.
>Take a look Jos:
>*Hay veces que incluso despues de un ZAP, ;
>se puede recuperar los registros, solo
>*funciona si no se han escrito datos ;
>encima de esos registros.
>
>*Ussage:
>*ZAP
>*=UNZAP(47) && restore 47 records
>
>PARAMETER Y
>SET STEP ON
>IF Y>0 .AND. USED()
> IF RECCOUNT()=0
> FILENAME=DBF()
> USE
> HANDLE=FOPEN(FILENAME,2)
> IF HANDLE>0
> BYTE=FREAD(HANDLE,32)
> BKUP_BYTE=BYTE
> FIELD_SIZE=ASC(SUBSTR(BYTE,11,1))+(ASC(SUBSTR(BYTE,12,1))*256)
> FILE_SIZE=FSEEK(HANDLE,0,2)
> BYTE8=CHR(INT(Y/(256*256*256)))
> BYTE7=CHR(INT(Y/(256*256)))
> BYTE6=CHR(INT(Y/256))
> BYTE5=CHR(MOD(Y,256))
> BYTE=SUBSTR(BYTE,1,4)+BYTE5+BYTE6+BYTE7+BYTE8+SUBSTR(BYTE,9)
> =FSEEK(HANDLE,0)
> =FWRITE(HANDLE,BYTE)
> =FCHSIZE(HANDLE,FILE_SIZE+(FIELD_SIZE*Y))
> =FCLOSE(HANDLE)
> ENDIF
> USE &FILENAME
> ENDIF
>ENDIF
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform