[Lazarus] TBufDataSet, TMemDataSet and a big headache.

Joost van der Sluis joost at cnoc.nl
Tue Jul 13 13:05:53 CEST 2010


On Mon, 2010-07-12 at 20:58 -0300, Marcelo B de Paula wrote:
> Hi list,
> 
> As the subject of this post suggest, i am in trouble with these components.
> 
> I read that TMemDataSet was similar to Delphi´s TClientDataSet as memory 
> dataset. But i also read that people was using TBufDataSet instead of 
> TMemDataSet.

TMemDataset is a memory dataset, has nothing to do/in common with
TClientDataset, except that it it a dataset that keeps data in memory.
(A lot of datasets do that)

TBufDataset looks like the TClientDataset. But do you really need
TClientDataset behaviour?

But there are some small bugs in older Lazarus and Fpc versions, which
can be fixed with only a few lines of code, but from the rest of your
mail I think it is best to advise to upgrade. Use a Lazarus 0.9.29
snapshot with at least fpc 2.4.1.

> What´s the best option if you want to work with memory datasets?
> 
> IMHO, bufdataset looks like an incomplete component. It does not have an 
> option to "create dataset" as memds has. But what confuses me the most is 
> the property editor accessed through context menu (right click component). 
> We already have a property editor assigned to fielddefs and accessed in 
> object inspector.
> 
> What exactly is this property editor for? Its option "Add fields" (ctrl+ins) 
> always give me the error "Abstract Method Called", and the other available 
> option "New" (ins), opens the New Field dialog with two possible options: 
> "Calculated" and "Lookup".
> 
> But how this is useful if bufdataset do not have an "OnUpdateError" event 
> published? It does not have an OnCalcFields event, so what is this 
> "calculated" field for?

You can access the OnCalcFields event from code. I think it's published
in later versions.

And a general tip: when reporting problems on this ml, always mention
your OS, OS version, fpc and lazarus version.

Joost.





More information about the Lazarus mailing list