×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

table corruption...
2

table corruption...

table corruption...

(OP)
Hi everyone....

I've noticed as we used my multi user (LAN) application, that during power interruption ( i dnt have UPS) the affected tables are always desame... corruption... in the access of those table, i use INSERT INTO... instead of APPE BLANK, does it have something to do with FLOCK() although i have not used FLOCK(). Do i need to put FLOCK() everytime I use INSERT into? do i have to change INSERT INTO to APPE BLANK? May I know whats the difference/s between the two? Thanks in advanced experts....

RE: table corruption...

Mandy, there is no programming technique that will avoid file corruption from a power outage. In a power outage without a UPS, the last state of the file will be what it is and can easily be corrupted, no matter if you use INSERT INTO or APPEND BLANK. No command does it better than the other. Both extend the file by one record and change the record count in the header. When that's actually written to the file and in which order is not even decided by VFP, but the hardware controller of the drive. So the thing to change, if power outages are not rare in your area, is to have a UPS. Not to change your code.

Do you need advice to repair the DBFs or do you have the tools for that?

Chriss

RE: table corruption...

I have a folder full of bookmarks for DBF repair utilities, but most of them seem to be out of date or no longer available. Here are two that at least still seem to be in existence:

https://www.dbf2002.com/dbf-recovery/index.html

https://www.cmstory.com/index.php

Don't take this as a recommendation. I've no personal experience of either of them. Power failures are very rare where I live, and when they do occur we often get a warning. (Perhaps I shouldn't have said that. I might be tempting fate.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: table corruption...

The most important thing you need to do is get a UPS (uninterruptible power supply) for every computer involved. Then, if power fails, you have time to shut down in an orderly way.

Tamar

RE: table corruption...

(OP)
Thank you Chriss Mike and Tamar...power outages here is almost three time a week... I think i willa have to buy a UPS... Thanks everyone.. I will just have to repair the corrupted dbf... God bless...

RE: table corruption...

The last power outage I experienced myself was about 8 years ago. And as I used a laptop the only thing that was gone was the internet. In your area, I would use no other computers but laptops. That doesn't work for things like a server rack or a NAS storage device, but a UPS is serving power to such things.

How long are the power outages, typically?

Chriss

RE: table corruption...

(OP)
Yes Mike. Believe or not... There are days that twice a day... And Chriss usually 15 to 30 mins... OMG...

RE: table corruption...

Quote (Mandy)

15 to 30 mins... OMG

Well, a UPS can last for such a time. And a laptop battery? Easy.

A UPS is something you'd normally only use to have a graceful shutdown of all systems, when you don't know how long the outage lasts. It's not used to continue working, usually. But if you have that usual breaks that's something you could plan for and manage to fix with a UPS for having continuous power. The only issues is, that the laptop battery and also a UPS need to charge/recharge to cover the next outage, of course. And, well, even if you power everything up to the final endpoint where you connect to the landline or cable the internet uses, it'll not just be a matter of your power bridging, whether that works.

Chriss

RE: table corruption...

Mandy, I'm only asking this out of curiosity, but are these power outages widespread across your entire community, or are they specific to your house or office building?

If the former, you would expect local politicians or activists to be making a fuss - or even pressure groups being set up to demand action.

If the latter, then it is presumably caused by some fault in the supply system. Have you had it investigated by an electrician?

Either way, it's hard to imagine modern society functioning without a reliable supply of electricity.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads

RE: table corruption...

(OP)
True Mike... Only in our municipality, i dnt know in other places Mike... We always complain but they always say clearing operation....

Your also correct Mike gagnon

RE: table corruption...

Or, make sure your users are on laptops with batteries, then no need for UPS at the user side. Just need one on the server if you're running in client/server environment.

Best Regards,
Scott
MSc ISM, MIET, MASHRAE, CDCAP, CDCP, CDCS, CDCE, CTDC, CTIA, ATS, ATD

"I try to be nice, but sometimes my mouth doesn't cooperate."

RE: table corruption...

I have an UPS on my main workstation (and screen) and I can work over 4 hours on that. That said, the longest outage I can remember the last 20 years was maybe 30 seconds :)

RE: table corruption...

Where I live, the power lines are above ground and there are many old trees, so we get several power outages a year ranging from a quick flash of the lights to many hours. (Longest I can recall was about 2.5 days after a major storm that knocked out power to hundreds of thousands.) We finally put in a generator a couple of years ago.

Tamar

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close