Jump to content
Stéphane Wierzbicki

TFDMemtable does not save indexdefs definitions

Recommended Posts



Does anyone know how to store a TFDMemtable with its indexes?


TFDMemtable.SaveToFile does not save indexes, I tried different formats ( sfXM,sfBinary,sfJSON).

I've also tried to either add indexes with TFDMemtable.IndexDefs or with TFDMemtable.Indexes


StoreItems is set to [siData, siDelta, siMeta].


I'm clueless. Any idea?



Share this post

Link to post

AFAIK, IndexDefs (as well as FieldDefs) are stored in the DFM when StoreDefs is True, but I guess they are not part of the data file.

Share this post

Link to post

@Uwe Raabe this could be an explanation but this can't be the reason why they are not stored (BTW FieldDefs are stored in the saved file).

The only solution I'm thinking to is to create a separate list that will hold indexes information. This is cumbersome as this could be done with the TFDMemTabble.SaveToFile method. 

Share this post

Link to post

For reasons I have never understood, the TDataset and its descendants stream data, but not properties. In my own work, I have had to deal with this in connection with the field properties we wish to pass to reporting code. It is all very nice to have Alignment, DisplayFormat, and DisplayLabel, but rather annoying that there is no option to include them in streaming.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now