[fpc-pascal] Dataset modification and reading at the same time
Michael Van Canneyt
michael at freepascal.org
Tue Oct 6 08:54:31 CEST 2009
On Mon, 5 Oct 2009, Felipe Monteiro de Carvalho wrote:
> On Mon, Oct 5, 2009 at 3:24 PM, David Emerson <dle3ab at angelbase.com> wrote:
>> Maybe you could do a sync operation or some such, to force changes to be
>> written to disk. It would probably slow the system down, but you might
>> be able to get it to work.
>
> Yes, but that's quite ineficient. I already have the data in memory,
> why write it to disk and read it again?
>
> My current solution is setting TDataSource.Enabled to false before
> reading and store the current record and after finishing the read go
> to the original record and enable the data source. Controlling to read
> as few times as possible it doesn't interfere much with the user
> editing.
>
> The whole problem is that I wish to have 2 current record pointers in
> the same database instead of only one, but that seams impossible with
> the current TSFDDataset. Maybe it's possible by extending it so that
> you can create a TSDFDataset which shares the memory of another
> already created one. If this second only does reading there should be
> no problem.
>
> And while talking about TSDFDataset, would a property to decide if
> newly inserted records should go after of before the current record be
> welcomed? I like to use the standard navigation component and I find
> it very user unfriendly to have new records go before the current
> record.
New records do Insert() and Insert goes before the current record so this
is normal. It is like that in Delphi as wwell.
Do an Append() instead.
Michael.
>
> thanks,
> --
> Felipe Monteiro de Carvalho
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
More information about the fpc-pascal
mailing list