>>>Sergey,
>>>
>>> This whole idea started from the following. My colleague wrote a DeNull program. This programs opens table exclusively and if field allows NULLs, changes it to not allow them. It doesn't check, whether file contains NULLs or not. First of all, this process may be slow on the huge files. Secondly, all of the sudden I had VFP crash today several times when it was running this program. It worked just fine few days ago, so I had no idea, what may cause this crash...
>>
>>I really wouldn't know if the crash may be coming from a field being marked as Not Null while having nulls in some records.
>>
>>I'd rather prevent the situation than get into analysis-paralysis with it. In the DeNull.prg, before setting a field to NotNull:
>>
locate for isnull(eval(cFld))
>>if found()
>> replace rest (cFld) with vDefaultValue for isnull(eval(cFld))
>>endif
>>Alter Table ...
>
>Dragan,
>
>I don't think, it's the reason. It worked fine with free tables with NULLs. Here is the situation: I have a table, which is part of a database. It has lots of validation field rules and record level rule. Each field here accepts nulls. Actually, this program should not been invoked on this table, but something was not right, so it was invoked and gave crashes. The file is empty. I replicated this problem several times. I added NOVALIDATE clause to ALTER TABLE command, but it didn't help and I still got VFP Fatal Error. So, few observations come to mind:
>1) DeNull program should check for not empty file
>2) It should add NOVALIDATE clause
>3) Something is wrong with VFP, empty table with validations and ALTER TABLE command.
>
>Can you please try to replicate this problem?
Sure, if you send me a sample - a copy of the .dbc and table. It can all be empty, with just this one empty table. Email address behind the envelope icon is the right one (just checked it).