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

TADODataSet.Cancel cancels entire batch

6 views
Skip to first unread message

Eric Harmon

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
Hi,

I've got a TADODataSet set up as LockType ltBatchOptimistic, client-side
static cursor. I allow the user to pop a dialog to add records to data set
one by one. If the user adds one record, and then pops the dialog to add
another, but hits Cancel, all the records the user added are canceled - not
just the current one.

Is this a "feature" of ADO, or is it something gone haywire in ADOExpress?
Is there a simple workaround?

Thanks in advance...

-Eric Harmon

Karlheinz Spaeth

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
Did you try ApplyUpdates?

--
Karlheinz Spaeth

BTW: I'm currently enjoying your wonderful book "Delphi COM Programming".


Eric Harmon

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
Karlheinz,

I don't want to apply the updates at this point. I've got one record in the
batch, and the user starts to add another. He then cancels the second
record. I still want the first record to remain in the batch - I don't want
to write it to the database yet.

-Eric
"Karlheinz Spaeth" <cha...@staufen.net> wrote in message
news:8boc0r$n2...@bornews.borland.com...

Karlheinz Spaeth

unread,
Mar 27, 2000, 3:00:00 AM3/27/00
to
I can't reproduce it.
I've tested with the ADO Test Application from the Delphi examples.

I used the following settings:

Client Cursor
Table Direct Mode
CursorType Static
Locktype BatchOptimistic


Problably you didn't use a client cursor?

--
Karlheinz Spaeth

Eric Harmon

unread,
Mar 28, 2000, 3:00:00 AM3/28/00
to
Karlheinz,

Yes, I did use a client cursor. I *didn't* use a table in table direct
mode, so I'll try it that way and see what happens.

-Eric

"Karlheinz Spaeth" <cha...@staufen.net> wrote in message

news:8boidn$ml...@bornews.borland.com...

The Counselor

unread,
Mar 30, 2000, 3:00:00 AM3/30/00
to


Eric,

I had exactly the same situation. Fortunately I was using a component, that
was derived from TADOQuery, so I was able to override the InternalCancel
method. If you look at that method it says:

procedure TCustomADODataSet.InternalCancel;
begin
Recordset.CancelUpdate;
end;

So I replaced it with my version:

procedure TLocalQuery.InternalCancel;
begin
RecordSet.Cancel;
end;

Works perfect for me!

Eric Harmon

unread,
Apr 3, 2000, 3:00:00 AM4/3/00
to
Mark,

Thank you!

-Eric

"Mark Edington (Borland)" <medi...@nolunchmeat.com> wrote in message
news:38e5276a@dnews...
> Eric, see my reply to the other message on this thread. You need to
comment out
> the line of code in the InternalCancel method, it doesn't belong there.
>
> Mark
>
>


0 new messages