Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Corrupt table
Message
From
24/04/2014 16:42:57
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
24/04/2014 16:30:14
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01598836
Message ID:
01599033
Views:
63
This message has been marked as the solution to the initial question of the thread.
>>>Hi All:
>>>
>>>On a USE, I'm getting the following message:
>>>
>>>
>>>Table 'Foo.dbf' has become corrupted.  The table will have to be repaired before using again.
>>>
>>>
>>>When I run a program (SBT) that uses this table, the system crashes with the following message:
>>>
>>>
>>>Table 'Foo.dbf' has a file length/record count inconsistency.  The table will need to be rapaired before transactions can be committed properly.
>>>
>>>
>>>My question is: Is there a way to repair the table without having to restore from a backup? Note that this table is part of a .DBC database.
>>>
>>>Thanks,
>>>
>>>Yossi
>>
>>
>>I don't know why this works, but I received a tip several years ago that sometimes cleans this up.
>>SET TABLEVALIDATE TO 0
>>USE myTable
>>GO BOTT
>>BROWSE
>>
>>Manually append 4 or 5 records (I use CTRL-Y in the browse window) and then DELETE the newly appended records.
>>
>>It doesn't work all the time, but it works frequently enough to be worth a try.
>>
>>.........Rich
>
>That seems to have worked. Thanks!
>
>One question: Are there still some gremlins lurking or does this pretty much recreate a pristine header?

Create a new table and fill with the data
Let's asume the table is not in a database and no idx files
use yourTable
copy to XYZ with cdx &&create a new table from scratch and fill
use
dele file yourTable.*
rename XYZ.dbf to yourTable.dbf
rename cdx.dbf to yourTable.cdx

use yourTable
this is more or less the same as PACK

Lutz
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform