Re: Saving last entries from the form
- From: "Mike Williams" <mikea@xxxxxxxxxxxxxxxxx>
- Date: Sun, 8 Apr 2007 23:35:23 +0100
<gq_uan@xxxxxxxxxxx> wrote in message news:1176069446.652576.202400@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Is there a way to save the last entries from a form? Lets say for
some reason the power goes out, or the program crashed or
something irregular happens and the information on the form
needs to be restored back onto the form as soon as it's opened
again. How would I go about doing this?
You need to periodically save anything that is important. Unless your system has some sort of UPS then when the power goes it just, well, goes and by then it is too late to do anything at all. Regular saving of important data is the key. If the system on which your code is running has a UPS then I think there will be ways of "picking up" the fact that there is a power outage, so that your program can then specifically save all of its data and perform a graceful shutdown before the UPS runs out of steam. I've never dealt with UPS stuff so I'm not sure on that point, but it's something you might like to look into. It is possible (quite probable, I imagine) that the UPS software will trigger a shutdown of all applications. If that is the case then it will cause your application to close and all your Forms to unload, so you could probably deal with it in your main Form's QueryUnload or Unload event (if your app actually has a Form). But basically, for something that will be reasonably reliable on all systems, whether they have a UPS or not, regular saving of important data to a disk file is the key. It might also be worth saving to alternate disk files on each occasion, so that a power outage on an unprotected system that occurs in the middle of a write access to a file has much lower chance of destroying the data (because the previous "incarnation" of the saved data will still be available next time the system starts up). There are probably people here who have experience of such things who will give you more detailed (and probably much better) advice, but those are my initial thoughts on something which I admittedly do not have any experience with.
Mike
.
- References:
- Saving last entries from the form
- From: gq_uan
- Saving last entries from the form
- Prev by Date: Re: How to suspend Windows?
- Next by Date: Re: How to suspend Windows?
- Previous by thread: Re: Saving last entries from the form
- Index(es):
Relevant Pages
|