Naomi --
Both reasonable suggestions, which I will try ...
Is what is going wrong here some failure when two people try to insert at the same time? No automatic file locking? (Just trying to understand the root cause).
Thanks,
Jim
>>I have an event history file which evidently can get corrupted.
>>
>>The only time the file is written to is by this code
>>
Select 0
>>Use (fname) Alias EventHistory Shared
>>
>>Insert Into EventHistory (When, who, pgmname, exename, desc1, desc2) ;
>> VALUES (MountainTime(),goVars.UserName, goVars.ApplicationName, Juststem(Sys(16,3));
>> , lcText1, lcText2)
>>Use
>>
>>
>>Do I need to put some locking around this, and, if so, what would the code look like?
>>
>>Thanks
>
>Well, you can set the buffering on this file to 5, do insert command, then do tableupdate(). Also perhaps you can calculate MountainTime in the separate variable before INSERT command.
Jim Nelson
Newbury Park, CA