Subject Re: [IBO] Dataset not in Edit or Insert mode
Author jwharton@ibobjects.com
Get the callstack on that exception and this will tell you what event/method is responsible for the looping back when it
shouldn't.

Jason Wharton
www.ibobjects.com

--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Apologies, previous email had misleading subject...


We are using delphi 5 with IBObject 4 and having the following problems with
an IBOTable component.

>From time to time: "Dataset not in Edit or Insert mode" when the dataset is
already in browse mode (posted a few lines before) and the code tries to
move the cursor to another record or to disable a data aware control.

Is it a known bug? Will it help if we upgrade delphi to 7 and IBObjects to
the latest version?

Following is relevant code:
----------------------------------
This one works

//<<<@@@69 Ning
dbed_VTitle.enabled := False;
//>>>@@@69

if (dm.tblVClient.State = dsEdit) or (dm.tblVClient.State = dsInsert)
then
begin
dm.tblVClient.Post;
dm.dbLandpak.SavePoint;
dm.tblVClient.Refresh;
end;
btn_EditVendor.ImageIndex := 0;
dbed_VSurname.enabled := False;
dbed_VGNames.enabled := False;


//<<<@@@69 Ning
//*
// Display "Dataset not in edit/insert mode" without apparent reason!
//
//dbed_VTitle.enabled := False;
//>>>@@@69



this one does not

if (dm.tblVClient.State = dsEdit) or (dm.tblVClient.State = dsInsert)
then
begin
dm.tblVClient.Post;
dm.dbLandpak.SavePoint;
dm.tblVClient.Refresh;
end;
btn_EditVendor.ImageIndex := 0;
dbed_VSurname.enabled := False;
dbed_VGNames.enabled := False;

dbed_VTitle.enabled := False;


another one

if dm.tblFile.active then
begin
//*
// dm.tblFile.locate returns an error saying dataset not in edit mode
when
// moving cursor to a different record. Even set the dataset to edit
mode,
// the error does not go away.
// I think this is a bug in the component!!!
//*
lFiltered := dm.tblFile.filtered;
try
dm.tblFile.filtered := false;

if dm.tblFile.locate('Filenumber', vararrayof([PayeeFile]), []) then
if PayeeType = 'V' then result :=
dm.tblFile.fieldbyname('MAINVLASTNAME').asstring else
result := dm.tblFile.fieldbyname('MAINPLASTNAME').asstring
else result := '';
finally
dm.tblFile.filtered := lFiltered;
end;
end else
--------------------------------


thanks,
Matthew

----------

WARNING -This e-mail, including any attachments, is for the
personal use of the recipient(s) only.
Republication and re-dissemination, including posting to news
groups or web pages, is strictly prohibited without the express
prior consent of
Thomson Legal & Regulatory Limited
ABN 64 058 914 668