Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Keep in mind the size of the table. Reaching 2GB will corrupt the table permanentlyHi
I am wondering, can we prevent a dbf table from corruption (headers) by using it with NOUPDATE (readonly) if I don't need write access.
But that's also a chance to find places where there is unintentional changes to the DBF that were the cause of earlier corruptions. Also with just reading a table you cannot prevent all errors, anyway. If a table already is corrupt using it won't do a complete health check of the DBF, in short VFP checks whether the record count that's stored in the table matches the expected size oif the dbf file that is HEADER()+RECCOUNT()*RECSIZE(), essentially. Maybe +1 for an EOF byte or plus some more, you can easily find out on healthy tables how that calculation turns out exactly the file size. But you never have a check which verifies every byte for validity in the corresponding context.plus if you do write to the table at some point and you just didn't spot it you've now sown the seeds for an Error 111.
100% agree, it is my biggest regret in the main VFP application I manage that the previous developers didn't leave any hope for ever migrating to a different database, short of completely rewriting the application from scratch and that's not really possible because the application is gargantuan. For this app, its age means it is no surprise to find database code is written at every level/layer. Calling it a spider's web would be giving the current level of separation a fake description of organisation, a rat's nest is definitely more accurate. I longed to migrate to another database, not just to reduce the chances of corruption, thankfully that's rare enough, but for things like easier updates when not needing exclusive access to DBFs, but it's just not possible for us, in this app.If you want to avoid file corruptions of dbfs and their related files, the only way to do that is to use another database.
Truly a problem, you can reduce that problem by using a rotation scheme like grandfather-father-son backups. Ideally VFP would be transactional, so every state, especially every healthy state of single records is kept so you could always at least get back to the last healthy state.This can mean that backups are not viable.
Can you please share it... In our application we have a formal utility for users to go through to fix that kind, it's quite nice, even if I do say so myself.