On 10/10/06, Joost van der Sluis <[EMAIL PROTECTED]> wrote:

Well... As I read it, that's not the problem. All changes are made in an
update-buffer first. So if you do a 'delete' in the grid, the records
get deleted in that buffer. Thus the record should disapear immediately
in the grid. But not yet on the database.

The 'delete'-sql is only send to the database on the .applyupdates
command. And committed on the .commitretaining. Thus that can happen
much later. (on the click on the 'save' button)

But if I understood you correctly, the delete fails immediately. That
means that there's a problem in the deletion of records in a grid. Or in
the .delete from Tbufdataset. You first have to test that. Easiest way
is to add a button 'delete' which does sqlquery1.delete. That'll delete
the current record, and it should be immediately visible in the grid.
Else you could do a .refresh after the .delete, to be sure that the grid
gets refreshed. (If not, it's a bug, btw)

I've added a button which calls query1.Delete.  The row disappears
from the grid now.     So, it looks like TdbNavigator's "Delete" button does
something different than it's supposed to do ?

However, when I press "Save" (which does applyupdates and commitretaining)
the program crashes with  :

TApplication.HandleException Access violation
 Stack trace:
 $08211A8E
 $0821AE3F  TCUSTOMDBGRID__UPDATESCROLLBARRANGE,  line 1336 of dbgrids.pas
 $0821B013  TCUSTOMDBGRID__DOLAYOUTCHANGED,  line 1402 of dbgrids.pas
 $0821CB35  TCUSTOMDBGRID__ENDLAYOUT,  line 2164 of dbgrids.pas
 $0821B660  TCUSTOMDBGRID__LAYOUTCHANGED,  line 1568 of dbgrids.pas
 $08219DA2  TCUSTOMDBGRID__ONDATASETCHANGED,  line 814 of dbgrids.pas
 $0821E518  TCOMPONENTDATALINK__DATASETCHANGED,  line 2722 of dbgrids.pas
 $0820E0F4
 $0820EEF5
 $0820F10B
 $08202E6B
 $08205F5D
 $08211320
 $08211264
 $0807DE10  TFORMASIMPLA__ACTIONCOMMITEXECUTE,  line 85 of forma_simpla.pas
 $0808DDB5
 $081755F2  TCONTAINEDACTION__EXECUTE,  line 110 of
./include/containedaction.inc

In ContainedAction.inc:

function TContainedAction.Execute: Boolean;
begin
 Result := (ActionList <> nil) and ActionList.ExecuteAction(Self)
   or ((ApplicationActionComponent<>nil)
        and ApplicationActionComponent.ExecuteAction(Self))
   or inherited Execute                         //
<------------------------- line 110
   or (SendApplicationMessage(CM_ACTIONEXECUTE, 0, PtrInt(Self)) = 1);
end;


Cheers,
Adrian Maier

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to