Johan De Beuckeleer

Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Findkey problem #55822
    Johan De Beuckeleer
    Participant

    Hello,

    I have a simular  problem after upgrading kbmMemTable from version 7.85 to 7.92.

    Setting IndexFieldNames does not order the records correct.

    When I use FindKey, the function returns “True”, but record is not positioned on the correct position.

    It is positioned on the first record.

    Setting Indexname (after opening the table)  shows the records in the correct order.

    The First and Last function work fine.

    It seems the behaviour of findkey changed from version 7.85 to 7.92 when the index is set by IndexFieldnames.

    Example:

    m_translations := TkbmMemTable.Create(nil);
    //Add fields
    m_translations.FieldDefs.Add(‘Key’,ftString,1024,True);
    m_translations.FieldDefs.Add(‘SubKey’,ftString,255,True);
    m_translations.FieldDefs.Add(‘LanguageID’,ftInteger);
    m_translations.FieldDefs.Add(‘Text’,ftString,1024);
    //Add Index
    m_translations.IndexDefs.Add(‘PK’,’Key;SubKey;LanguageID’,[ixPrimary]);
    m_translations.IndexFieldNames := ‘Key;SubKey;LanguageID’;

    m_translations.Open;
    m_translations.IndexName := ‘PK’;  // =>> if this line is ommitted, Findkey doesn’t work.

    So changing the index using IndexFieldNames doesn’t seem to work starting from version 7.92.

    It seems we will have to create indexDefs and change the IndexName.

    Greetings

    Johan De Beuckeleer

Viewing 1 post (of 1 total)