Monday, July 05, 2004

One of the possible cause VFP table corruption

If you are using VFP table in your application, you may ever get headache of table corruption espcially if your table contains memo field. It doesn't meant VFP table is not stable, instead, it usually caused by hardware failure, power failure, bad memory, unstable network and etc. Therefore, for those who plan to use VFP table as your storage, make sure you use good hardware and build up a stable network.

For last few days, one of our clients reported data loss in our system. We go to check out the problem immediately. We don't have any repair tool, so we use our cheapest and stupid way to repair it :
  USE myTable EXCLUSIVE

SELECT * FROM myTable WHERE .T. INTO CURSOR csrTemp NOFILTER
SELECT myTable
ZAP
APPEND FROM DBF("csrTemp")
The code above alway works fine to repair table, may be memo field data will be lost. Anyway, it would be re-keyin manually without a big problem. However, it didn't help for them. We start suspecting hardware problem in one the pc. Since, we are using file sharing technique, data processing is done in workstation. We have difficulty to check every workstation. The biggest problem is system can't be stopped at that time. Finally, we found that is Window's "problem".

The problem is caused by the difference between the file locking in Windows 98 and earlier, and the file locking in Windows XP. Mirosoft Knowledge Base reported the error
Error 41: "Memo file is missing or invalid" error message when you access tables on computers that are running Windows 98 or earlier from computers that are running Windows XP.
From this experience, we know that this problem may not cause error 41 but corrupt your table without notice.

Resolution, Use a computer that is running Windows XP as the file server.

Hope this case study solve your future table corruption problem (of course, we never wish to has any corruption). :)

0 Comments:

Post a Comment

<< Home