>
> We want to VALIDATE our database when we open it to prevent problems with
> bad data. The problem is if the VALIDATE doesn't pass it bypasses our
> ONERROR proc and crashes the system. Is there some way to use VALIDATE and
> elegantly exit if there's a problem with the database?
>
> TIA
I think yes. A while ago there was a thread about this. Validate command
into function or so, and based on this I made my custom class that takes
care about half of this problem. The idea was - validate two databases
into two text files. First was just temporary database created for need
of validating and after that it was deleted and the second one was
*real* database. Then comparing the size of these two text files decided
if *real* dtb was correct or not.
I took a little of this idea and here's what I do. I validate database
into text file and using low-level file function I *read* this file. If
I find 'Database contaniner is valid' on third line I know I'm fine
(this I have done). If not ( thoughts ) I want to find the word that
that reffers to the object that caused error and try to fix it. Fooling
around the different error messages I was trying to produce I found this
way could be possible and it can be done. Seems it should work also as
*fixer* of some errors that can be corrected - I mean reindexing or
recreating corrupted indexes - by now no idea what to do if a table is
corrupt.
So hth, and pls keep me inform if you find something better.
Dezider
--
There were three worst disasters in the history of human
race in 20-th century:
1, Hiroshima 44
2, Tchernobyl 86
3, Windows 95