Okay I want to blame windows and maybe a flakey computer for this but
I'm also seeking advice on how to avoid the loss again.
My compiled QB4.5 program uses variable length, csv files for the
data. So when you want to change any record, I use the standard
method of opening a new temp file, read all the old records, update
the affected record, write to a new file, close, delete the old file,
rename the temp to the old file.
We use this db program for s****ting events to do entry lists, results,
etc, so it gets intense use for short periods of time. The db file
rarely runs over 50k bytes.
I and several other users (including novices) have been using this
program for many years. Yesterday on a questionnable IBM laptop
running XP that got a new motherboard installed friday, it re****ted an
error similar to file already exists and deleted the file, leaving
nothing. I'm guessing it's Windows fault. It seemed slow to do many
things, so it looks like windows was taking it's time doing the
requests and just got ahead of itself. Deleted the original before it
finished reading/writing the new file.
This basic routine of read/write/rename/delete has been done countless
times without a hitch until yesterday. Like 100,000+ times?
There are some sort operations that use the same basic read/write/
delete/rename routine that don't actually change data, just resort the
file that could face the same risk. Modify, delete, sort, merge in
results all do the same. Add (or clone) a new record just append.
Anyhow, i want to add some sort of multi generational backup system.
I was thinking of just creating a backup folder and copying the whole
db into the backup everytime there is a change. That would be quick
and easy but would take up lots of cheap space. I was thinking of
naming those backup files sequentially or trying to do some sort of
date & time coding in the file name. They can always be deleted at
the end of the day.
Another though was to do a transactional backup. Copy modified
records to an extra file, include date & time fields, so they could be
used to rebuild a file.
I don't want to give up on qb45, I feel more comfortable programming
in qb45. The alternative would be vb6.
In any case, I do want to add a automatic backup routine and am
looking for suggestions.
Rick
PS, the operator was making backups regularly to a sandisk usb memory
stick that got screwed up at about the same time.


|