Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Restoring deleted records
Message
De
21/02/2006 16:35:58
 
 
À
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:
01097906
Vues:
14
>>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

I think this code would be extremely dependent on whether the file was fragmented or not. If the file is fragmented, there's no guarantee that the next physical sector would contain data that used to belong to the file.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform