Corrupted database
Ivan Smahin
ivan_smahin at paradigmasoft.com
Tue Dec 9 03:02:55 CST 2014
On Dec 9, 2014, at 8:38, François Van Lerberghe <frvanlerberghe at gmail.com> wrote:
> Hello,
>
> After many month using my database, yesterday, Valentina return me an error
> in its structure, shown in a Diagnose report :
>
> ==========> Field: Notes , type Text
> .RecID: 1516. Segment: 249. already in use.
> .....> SegmentFile:
>
> All right! ( SegmentFile: )
>
>
> Problems found! ( Field: Notes , type Text )
>
>
> I use Valentina 5.6 (V4RB v5.6) on MacOS 10.6.8
> Do someone have an idea on what can give me this corruption ?
>
> - When I want to update a VTextField with a string, I do :
>
> if myString = "" then
> if isExistingRecord then
> myVTextField.DeleteData
> else
> myVTextField.SetBlank
> end if
> else
> myVTextField.Value = myString
> end if
>
It looks like you are going to call cursor.AddRecord or UpdateRecord - not deleteRecord.
Anyway, SetBlank and DeleteData are very similar.
- field.SetBlank - set the default value/expression to the field or set sql-null if no such default values/expression.
- blob.DeleteData - just set sql-null - always.
So if you have no default value/expression for that text-field you may call myVTextField.SetBlank for both cases.
> - When I want to delete a Vcursor record containing a VTextField, I do :
> myVCursor.delete
>
> Is it the right way to do that ?
If you want to delete cursor (table) record you should not modify any field for that before - just do cursor.DeleteRecord.
--
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com
More information about the Valentina
mailing list