Hi Vinx,
> But... well... how do you check when the index are being corrupted ?
> What cheat do you use ?? :) Let me know...
Index corruptions encounters as soon as the index is not synchronized with
the database. Under normal circumstances (no programing errors), they only
get corrupted if a user made changes to the dbf which aren't written to the
index.
Cause: Abnormal program termination (or bad EMS).
Clipper uses (by default) EMS/XMS to store indexdata. Modifications to the
indexdata will be written to disk after a commit statement or quiting the
program. Under abnormal circumstances, this data won't be written to disk and
there is your index-corruption.
You can detect when its time to reindex. I found this solution over here and
it works fine with me.
Add every user as soon as it starts your app (in a seperate dbf calles USERS
eg.). Delete this record when the users finishes your app.
At the start of your program, you FIRST check if the user you're about to
add is already in the USERS dbf. If not, proceed.
If he/she is in the USERSdbf, its time to reindex.
If you're able to send a message over the LAN, do so when you encounter an
indexcorruption according to the above methode, including the name of the
user who is causing the misery. The user will soon get the point that he/she
is doing something wrong, or other users will inform him/her. If it is a
hardware problem, you also know which station needs some investegation.
I hope it works for you too.
Good luck, regards,
Vincent.
--- FMail 0.94
---------------
* Origin: Voorlopig mijn laatste origin! (2:285/308.1)
|