Board index » delphi » Capturing the error - not in insert or edit mode

Capturing the error - not in insert or edit mode

Does anyone know how to capture the error of "dataset not in insert or edit
mode"?

I've tried the OnError events for the table... but to no avail.

I would like it to perform some type of function where I can see that the
dataset is not in edit mode, so Edit is called and then Action is set to
retry -- unfortunately it seems like you never get to the error checking
areas of the dataset.

Mike Newkirk
Planning Consultants, Inc.

 

Re:Capturing the error - not in insert or edit mode


Mike

try the following:

with table1 do begin
  if not (State in [dsEdit, dsInsert]) then
    Edit;
// some action here
end;

Regards
Peter

Quote
> I would like it to perform some type of function where I can see that
the
> dataset is not in edit mode, so Edit is called and then Action is set
to
> retry -- unfortunately it seems like you never get to the error
checking
> areas of the dataset.

> Mike Newkirk
> Planning Consultants, Inc.

Sent via Deja.com http://www.deja.com/
Before you buy.

Re:Capturing the error - not in insert or edit mode


I always preface any coded editing with this:

if not (MyTable.State in dsEditModes) then
    MyTable.Edit;

Woody

Quote
"Nuke" <DelphiCo...@nat.pci-dahl.com> wrote in message

news:957466114.873665@pizza.crosslink.net...
Quote
> Does anyone know how to capture the error of "dataset not in insert or
edit
> mode"?

> I've tried the OnError events for the table... but to no avail.

> I would like it to perform some type of function where I can see that the
> dataset is not in edit mode, so Edit is called and then Action is set to
> retry -- unfortunately it seems like you never get to the error checking
> areas of the dataset.

> Mike Newkirk
> Planning Consultants, Inc.

Other Threads