Home › Forums › kbmMemTable › Findkey problem
- This topic has 5 replies, 4 voices, and was last updated 4 years, 5 months ago by
kimbomadsen.
-
AuthorPosts
-
-
March 4, 2021 at 19:04 #55564
zoran
ParticipantHi Kim
At design time I populate FieldDefs and IndexDefs. All other settings are default. In code I have:
mt.IndexFieldNames:= ‘Age’;
mt.IndexName := ‘ix_Age’;mt.FindKey([2]); //there is a row with Age=2.
Here I get error: ‘There must be at least one field.’
This started happening with kbmMemTable 7.91.0.
All my production programs compiled with the new version show the same error.
Additionally, I cannot set IndexName at design time. Index name is shown in drop down combobox, but when I select it IndexName field stays empty. I tried that with demo program that comes with kbmMemTable and the same happens – cannot set IndexName at design time.
I have 5 lines demo that illustrates this.
D 10.3.3, kbmMemTable 7.91.0, kbmMW 5.14.0 Ent.
Thank you.
Zoran
-
This topic was modified 4 years, 9 months ago by
zoran.
-
This topic was modified 4 years, 9 months ago by
-
March 4, 2021 at 19:31 #55566
zoran
ParticipantIn debugger after
mt.IndexFieldNames:= ‘Age’;
mt.IndexName := ‘ix_Age’;both fields are still empty (?).
-
June 10, 2021 at 09:00 #55822
Johan De Beuckeleer
ParticipantHello,
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
-
June 30, 2021 at 08:21 #55831
Yusuf Zorlu
ParticipantSame problem here! Kim can you please check this asap because ordering / sorting with
table.IndexName
table.IndexFieldnames
table.SortFieldsis not working any more! Code which has worked before 7.92 has problems now and we have urgent calls because of this here!
-
June 30, 2021 at 08:38 #55832
Yusuf Zorlu
ParticipantIf you set .Indexname / .IndexFieldnames / .Sortfields when the table is closed, it will not work.
Setting these properties right after opening the table works in our case.
-
July 2, 2021 at 22:28 #55836
kimbomadsen
KeymasterHi,
I have fixed the reported bugs. Fix will be in 7.93 to be released shortly.
/Kim
-
-
AuthorPosts
- You must be logged in to reply to this topic.
