Opening a native table is very vulnirable to sudden power failure. So which is safer of the two; Using directly the table or make a view of that certain table before using it
Opening a native table is very vulnirable to sudden power failure. So which is safer of the two; Using directly the table or make a view of that certain table before using it
which is safer to use table or view?
Sajaki
In 20 years of working with DBFs I only had this happen to me once, many years ago.
There is only one reason not to have an Uninterrupible Power Supply (UPS) unit on each PC, server, router.
The only reason not to have one is when the value of the data or the cost of re-building the data is less that the cost of the UPS. How often does this happen How many hours a week/month/whatever do you lose rebuilding/re-entering lost data There's your simple math to compare the cost and tell your boss to buy a UPS. :)
Crosscourt
- The program should make backup. I don't how about how much data we talk here, but the application should make a copy of all tables when it starts, work on the copy and copy them back when it shuts down. If you rename the original files before you copy the working copy of the real data, you can even catch the case that the application crashes in the middle of a shut down.
- Don't keep the tables open. It slows down the program a bit, but try to keep all tables closed. Only open them as needed. Opening a view opens the table.However, you can close it right afterwards. When VFP updates the view into the table, it opens the table itself again.
- Do not perform batch updates. Update one record (or one set of related records), close the table, open it, update the next record.
- Do not rely on your customer to do maintenance tasks. Your system should do all the backups automatically.
juanazo
Here's also another question, Has any idea why VFP did not include a recovery tools for there native dbf or I only miss that topic in help file, Why is it that we have to look for a third party tools for a dbf recovery
Scott Ha
Since I cannot control the generators I make sure I have NO INDEXES kept open, I also delete tag all after every report, and I delete each index file before reindexing.
I still get a problem every couple of months but my solution is to create backups of the critical data every few minutes. If the error handler reports one of the error numbers that relate to indexes or corruption then I copy the backup over and continue.
Good Luck.
Don Higgins
www.crewchiefpro.com
WinL
So from a corruption-due-to-power-failure standpoint, there isn't really any difference because you cannot have a view open without the table being open. Even if you could, you wouldn't want to open the table just long enough to post changes in the view into the table, and then close the table again.
So I agree with Alex -- you need to resolve your power supply issue.
Drew Speedie
VFP MVP
anametrix
No matter how you explain that to your client but sometimes when things go right for months, a year, they will forgot to do routine maintenance to their system.
So there comes an unexpected call, telling you that their system doesn't work anymore due to corruption. I will then instruct them to reinstall their backup, the answer is this 'OHH NO... we don't backup our data's for a month now... see..
I dO not use native dbf for my FP application, I use MS SQLServer since the release OF VFP6, but I have a customer that has a know-how about programming in FP, that is why he doesn't like other back-end, for some reason I do not know.
So problem isn't it
Kallex
Anyway, thank you very much to all of you, at least I got another idea what to do next.
Have a nice day & more power to all of you...