Ver Mensaje Individual
  #8  
Antiguo 30-08-2007
[David] David is offline
Miembro Premium
 
Registrado: may 2003
Ubicación: Málaga
Posts: 417
Reputación: 22
David Va por buen camino
El caso es que la estructura del programa es algo así , con ClientDataSet de detalle .

Código Delphi [-]
// inserto los datos en un ClientDataSet , por ejemplo Client1
Client1.post.

// compruebo si el detalle tiene datos

if not ClientDetalle.isEmpty then
begin
 while not ClientDetalle.eof do
  begin
    // inserto los registros
     ClientDetalle.post;
 end;
end;

// Después haria supongo esto

if (Client1.ApplyUpdates(0) = 0) and (ClientDetalle.ApplyUpdate(0)=0) then
begin
 Commit;
 Result := True;
end
else
begin
 Rollback;
 Result := False;
end;

Bueno , pues eso , ya para poner el código definitivo , me gustaria saber si lo anterior por lo que habeis comentado es ya lo correcto.
Responder Con Cita