Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Tablas planas (https://www.clubdelphi.com/foros/forumdisplay.php?f=20)
-   -   problemas al borrar campo en dbgrid (https://www.clubdelphi.com/foros/showthread.php?t=39999)

leodelca23 05-02-2007 01:33:34

problemas al borrar campo en dbgrid
 
tengo un problema al querer borrar una linea en el dbgrid, al parcer presiono el boton de eliminar y al parecer lo elimina perfectamente y de repente cuando hago una consulta nunca fue borrado la linea. El boton es el siguiente. Y si uso el boton del dbnavigator pasa lo mismo. Uso tablas con interbase y no se como solucionar esto les agradezco que me ayuden. Gracias



Código SQL [-]
procedure TFFacturacion.BeliminarClick(Sender: TObject);
var
temp,difst,importe:double;
begin
if contador = 0 then
begin
  showmessage ('No hay elementos en el detalle para borrar');
  dbgdetalle.Enabled:=false;
end
else
begin
temp:=0;
fbases.ibProducto.Locate('IDPRODUCTO',fbases.ibDetalleidproducto.AsInteger,[]);
fbases.ibProducto.Edit;
temp:= fbases.ibProductoCantidad.AsFloat;
fbases.ibProducto['Cantidad']:=temp+fbases.ibDetalleCantidad.asfloat;
fbases.ibProducto.Post;
dbgdetalle.Enabled := true;
dbgdetalle.DataSource.DataSet.Delete;
dbgdetalle.Enabled := false;
while not fbases.dsdetalle.DataSet.Eof do
  begin
    if not varisnull(fbases.dsdetalle.DataSet.FieldByName('SubTotal').value) then
      Importe := fbases.dsdetalle.dataset.FieldByName('SubTotal').value
    else
      importe:=0;
    difst := importe + difst;
    fbases.dsdetalle.dataset.next;
  end;
fbases.IBFACTURA.Edit;
fbases.ibfacturatotal.Value:=difst;
contador:=contador-1;
end;
end;

Neftali [Germán.Estévez] 05-02-2007 11:39:54

Revisa el tema de transacciones.
Tiene pinta de que sea un Rollback.


La franja horaria es GMT +2. Ahora son las 12:32:32.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi