[fpc-pascal] how to directly access field/record value of TBufDataSet?

Dennis Poon dennis at avidsoft.com.hk
Tue Oct 1 09:50:26 CEST 2013



Michael Van Canneyt wrote:
>
>
> On Tue, 1 Oct 2013, Dennis Poon wrote:
>
>> Since TBufDataSet is in-memory, to speed things up, how can I 
>> directly access the N'th record and M'th field's value as Variant?
>>>
>>> Simply said: You cannot.
>>>
>>
>> Can any one suggest an in-memory dataset in fpc/lazarus that allows 
>> direct access?
>>
>> Does TMemDataset allow it?
>
> No. The architecture of TDataset does not allow this.
>
> The buffer mechanism is quite complicated, and there are quite some 
> layers to go through.
>
> T(Mem)Dataset is not just an array of records. The records can be at 
> wildly different locations,
> the values may or may not be computed. Blobs are stored entirely in 
> different locations etc.
>
> Michael.
>

That is too bad. I used to use TdxMemData from "DevExpress" and it 
allows such direct access.

The benefit is record can be accessed without CHANGING the current 
record pointer which will trigger updating of all linked DB controls 
(that could be time consuming or even confusing to the user).



More information about the fpc-pascal mailing list