Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TDataSet.OnNewRecord: TDataSet.Insert or TDataSet.Append

86 views
Skip to first unread message

Hubert Anemaat

unread,
Jul 2, 2008, 4:33:13 AM7/2/08
to
Hello,

How can my Delphi application see the difference between a
TDataSet.Insert and TDataSet.Append in the method TDataSet.OnNewRecord ?

Thanks,

Hubert

Paul Hughes

unread,
Jul 2, 2008, 6:15:45 AM7/2/08
to
"Hubert Anemaat" <hub...@anemaat.nl> wrote in message
news:486b3d4c$1...@newsgroups.borland.com...

> Hello,
>
> How can my Delphi application see the difference between a TDataSet.Insert
> and TDataSet.Append in the method TDataSet.OnNewRecord ?
>
Have a look at the TDataSet.State property and test for dsInsert or
dsAppend.

Regards, Paul.


Hubert Anemaat

unread,
Jul 3, 2008, 4:00:10 AM7/3/08
to
Hello Paul,

There is no dsAppend state.

Hubert

Paul Hughes schreef:

Paul Hughes

unread,
Jul 3, 2008, 5:30:12 AM7/3/08
to
"Hubert Anemaat" <hub...@anemaat.nl> wrote in message
news:486c870f$1...@newsgroups.borland.com...

> Hello Paul,
>
> There is no dsAppend state.
>
> Hubert

Hi Hubert,

I'm sorry, you're quite right. I think I must have been thinking of dsInsert
versus dsEdit.

Normally, if you are in control of adding the record, you would either be
calling insert or append. Is it possible you could set a flag here which you
can check later on in the process?

What is you're trying to accomplish with this? Maybe there's a simpler or
alternative way to do what you wanted.

Regards, Paul.

Alexandre Machado

unread,
Jul 3, 2008, 7:48:38 AM7/3/08
to
Hubert Anemaat escreveu:

There is no way using TDataSet properties/events. Checking VCL source
code (DB.PAS) you can see that TDataSet.Insert and TDataSet.Append
methods are quite the same.
And worse, VCL won't let you override those methods in you own custom
descendant.

Regards

0 new messages