[fpc-devel] Hi

Joost van der Sluis joost at cnoc.nl
Sat Oct 11 00:32:16 CEST 2008


Op vrijdag 10-10-2008 om 20:31 uur [tijdzone +0200], schreef Dusan
Halicky:
> I'm trying to create "lightweight xml dataset" derived from TDataSet.
> I've studied various other datasets (TFixedFormatDataset,
> TParadoxDataset, TMemDataSet) but it's too complicated, perhaps
> because there are no comments at all. Can someone help me at least
> with some info how it works? Is there any documentation on datasets?

Yup, it ain't easy. But I think that TBufDataset is the best one to look
at. What you could also do is use TBufDataset as parent for your
dataset. That way you only have to implement a few methods.

> Right now I'm trying to create some dataset which return static data
> (e.g. table of numbers from 1 to 100 in column1 and random strings in
> column2, some boolean in column3). I finally have something in the
> dbgrid but it acts weird, I have no idea how to handle data.

You probably need to implement RecNo, or bookmarks.

> The reason I need my own dataset is that I am creating 3-tier
> application in lazarus. The key feature why I need proper dataset is
> that If I select too many data, e.g. 10k rows table, the dataset will
> fetch only few lines and then when user scroll the dbgrid new data
> will be fetched. As far as I know, this can be done only in TDataSet.

That's all implemented in TBufDataset. It you create a descendent of
TBufDataset, you're done.

Joost.




More information about the fpc-devel mailing list