Ver Mensaje Individual
  #9  
Antiguo 23-06-2004
Avatar de marto
marto marto is offline
Miembro
 
Registrado: may 2003
Ubicación: Barcelona, Catalunya
Posts: 882
Reputación: 22
marto Va por buen camino
Código Delphi [-]
   while not QEasy.Eof do
   begin
      TCT_TOTAL.Append;
      for i := 0 to QEasy.Fields.Count - 1 do
          TCT_TOTAL.Fields[i].Value := QEasy.Fields[i].Value;
      try
        TCT_TOTAL.Post;
      except
        on E: EDatabaseError do
        begin
          if Pos('KEY VIAOLATION', E.Message) > 0) then
          begin
            Texto := 'Duplicado el registro con ID: ' + QEasy.FieldByName('ID_CT').AsString;
            Application.MessageBox(PChar(Texto), 'Registro duplicado',mb_Ok+MB_ICONEXCLAMATION);
            TCT_TOTAL.cancel;
          end else
            raise;
        end;
      end;
      QEasy.Next;
   end;

Lo que quieren decir los compañeros es esto... y cárgate el OnPostError
__________________
E pur si muove
Responder Con Cita