1

I have 50 or 60 records of four or five fields. I need to load the records into RAM (From a CSV file), search on different fields, enumerate, etc. Not a lot of data, not a lot of functionality.

I was all excited to use the new (to me in D2010) TDictionary or TList, but thought that a TClientDataset (which I've never used before) might be more appropriate.

With a TClientDataSet, I can use .Locate on any field, enumerate with while NOT CDS.EOF, etc.

And, what exactly is this MidasLib that I have to use with CDS? Can I reasonably expect it to be supported in the future?

Is TClientDataSet still considered state-of-the-art, or is it showing its age and somewhat deprecated (literally and figuratively)?

I've seen colleagues use DX's TdxMemData. Why use it (or any of the other handful of memory datasets I've seen while googling this issue) rather than a CDS?

Related question: Delphi: using TClientDataset as an in-memory dataset

1 Answer 1

1

TClientDataset is a very useful tool. You can do a lot of things with it that you can't do with a dictionary, such as filtering and binding data-aware controls. And it's still an active part of Embarcadero's toolset.

Midas is the in-memory database technology that TClientDataset is based on. It's a separate library, but there's a MidasLib unit that you can include in your EXE if you don't want an external DLL dependency.

As for TdxMemData, I've used it a little at work, but I don't care for it all that much. It doesn't have CloneCursor, which is one of TClientDataset's best features. It allows you to take a second client dataset and have it "clone" the first one, and then you have two client datasets that point to the same data store, but with different active records, filtering options, and various other properties. It's very useful for setting up multiple different "views" based on the same base data.

2
  • Can you suggest a good TClientDataset tutorial or write-up covering advanced features (such as CloneCursor)? Apr 21, 2010 at 1:45
  • Cary Jensen has several excellent writeups on using client datasets on EDN, including one article dedicated entirely to cloning cursors. You can find them under gp.embarcadero.com/authors/edit/3030.aspx Apr 21, 2010 at 1:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.