Ver Mensaje Individual
  #10  
Antiguo 18-09-2008
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.310
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
A mi con un código como este (lo he hecho a partir del tuyo) funciona perfectamente y me inserta varios registros.

Código Delphi [-]
var
  i:Integer;
begin

  for i := 0 to 5 do begin
    with ClientDataSet1 do
    begin
      Insert;
      FieldByName('EmpNo').AsInteger := -(i - 1);
      FieldByName('LastName').AsString := 'aaaaaaa' + IntToStr(i);
      FieldByName('FirstName').AsString := 'bbbbbbb'  + IntToStr(i);
      FieldByName('PhoneExt').AsInteger := 500 + i;
      Post;

    end;
  end;

  ClientDataSet1.ApplyUpdates(-1);

Revisa que el error no te lo estén generando los datos que insertas; Problemas con claves duplicadas, índices únicos,...

Revisa el parámetro entero del ApplyUpdates que te da el número de errores; También puedes intentar programar alguna cosa en los eventos que se refieren a los posibles errores en la inserción; OnPostError, OnAfterPost, OnAfterApplyUpdates,...
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita