Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to trap a VALIDATE error?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00026440
Message ID:
00027043
Views:
37
>>
>> 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
>
>--

Dezider-

Thanx for the response. Unfortunately I cannot open the database exclusive since it is shared on a network. VALIDATE DATABASE doesn't work on shared databases.
"It is an important and popular fact that things are not always what they seem. For instance, on the planet Earth, man had always assumed that he was more intelligent than dolphins because he had achieved so much -- the wheel, New York, wars and so on -- whilst all the dolphins had ever done was muck about in the water having a good time. But conversely, the dolphins had always believed that they were far more intelligent than man -- for precisely the same reasons." - Douglas Adams
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform