assertion failure
Posted: Tue 01 Jul 2008 07:39
hi,
im opening a table in a form where this table is not updated with new fields. so an error occurs : field 'xxx' not found. which is normal.
but once i close the form, an error occurs : 'assertion failure
(D:\Projects\Delphi\Dac\Source\MemDS.pas, line 2563).
i traced my code and i found that this error is raised due to my code :
procedure TMyForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
...
table.cancel;
...
end;
i added this code :
if Table.State in [dsEdit,dsInsert] then
table.cancel;
and its working now.
but i need to know what is this bug and how to avoid it.
might appear later on another function rather then canceling table.
any sugestions?
im opening a table in a form where this table is not updated with new fields. so an error occurs : field 'xxx' not found. which is normal.
but once i close the form, an error occurs : 'assertion failure
(D:\Projects\Delphi\Dac\Source\MemDS.pas, line 2563).
i traced my code and i found that this error is raised due to my code :
procedure TMyForm.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
...
table.cancel;
...
end;
i added this code :
if Table.State in [dsEdit,dsInsert] then
table.cancel;
and its working now.
but i need to know what is this bug and how to avoid it.
might appear later on another function rather then canceling table.
any sugestions?