On Mon, 2006-10-09 at 15:46 -0400, Adrian Maier wrote:
> On 10/9/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >
> > On Mon, 9 Oct 2006, Adrian Maier wrote:
> >
> > > On 10/9/06, Christian Ulrich <[EMAIL PROTECTED]> wrote:
> > > >
> > > > > - deleting rows doesn't work for any of the tables.  The user is asked
> > > > > to confirm, but the row is not deleted.
> > > >
> > > > maybe its deleted and not drawn in the dbgrid ??
> > >
> > > Nope.  I am monitoring all the commands that are sent to the database,
> > > and I haven't seen any DELETE.
> > > Also, after restarting the program the row is still there. I'm pretty sure
> > > that
> > > for some reason the delete command is not executed at all.
> >
> > Did you call applyupdates ?
> > I think SQLQuery does some buffering of commands ?
> 
> Yes:  I have a "save" button that does:
>     query1.ApplyUpdates;
>     Ftransaction.CommitRetaining;

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)

Then we know who has to look at the problem, me or Jesus. ;)

Joost.



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

Reply via email to