Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Problem repairing a corrupted file
Wed, Nov 16 2011 10:41 AMPermanent Link

marcioehrlich

The code below is not reaching the RepairTable line, because when the application tries to verify this specific table it raises a header corrupt error and jumps to the Finally code.
So, how am I supposed to detect a header corruption in order to issue a RepairTable?

Try
 with Table1 do
   begin
     Close;
     Exclusive := True;
     If not VerifyTable then
        RepairTable;
     Exclusive := False;
   end;
Finally
  ShowMessage('Done!');
End;

Thanks,
Marcio
Wed, Nov 16 2011 11:07 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Marcio


>The code below is not reaching the RepairTable line, because when the application tries to verify this specific table it raises a header corrupt error and jumps to the Finally code.
>So, how am I supposed to detect a header corruption in order to issue a RepairTable?

If the header is corrupt I don't think there is much that can be done. Try repairing in DBSys and if that works you could modify your code to the following


>Try
> with Table1 do
> begin
> Close;
> Exclusive := True;
try
> If not VerifyTable then
> RepairTable;
> Exclusive := False;
> end;
except
try
RepairTable;
except
Showmessage('Unrecoverable table corruption');
end;
end;
> Finally
> ShowMessage('Done!');
>End;


Roy Lambert [Team Elevate]
Mon, Nov 21 2011 1:04 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Marcio,

<< The code below is not reaching the RepairTable line, because when the
application tries to verify this specific table it raises a header corrupt
error and jumps to the Finally code.
So, how am I supposed to detect a header corruption in order to issue a
RepairTable? >>

If you have a table that the repair functionality cannot handle, please send
it to me and I'll investigate further.  Usually the case is that the table
data header is completely overwritten with junk data, but sometimes it is
something more benign like the index header that is messed up.

--
Tim Young
Elevate Software
www.elevatesoft.com
Thu, Nov 24 2011 1:43 PMPermanent Link

marcioehrlich

Tim,

Fortunatelly, the method suggested above fixed the table. I am really focused in trying to do it programmatically so the user is able to do it without asking me!!
Thanks anyway.

Marcio Ehrlich


"Tim Young [Elevate Software]" wrote:

If you have a table that the repair functionality cannot handle, please send
it to me and I'll investigate further.
Wed, Nov 30 2011 5:22 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Marcio,

<< Fortunatelly, the method suggested above fixed the table. I am really
focused in trying to do it programmatically so the user is able to do it
without asking me!! >>

That's why I asked for the table.  If the repair cannot handle a specific
type of problem, then I examine the issue and see if it is something that
can be added as an improvement.

--
Tim Young
Elevate Software
www.elevatesoft.com
Image