Ver Mensaje Individual
  #3  
Antiguo 25-03-2014
camiz camiz is offline
Miembro
 
Registrado: ene 2012
Posts: 69
Reputación: 13
camiz Va por buen camino
ecfisa, eres un genio un grandicimo gracias por tu ayuda. Tu código funciona perfecto...

solo tuve que cambiarle
Código Delphi [-]
f:= 0;
por
Código Delphi [-]
f:= 1;
porque me botaba error a la hora de guardar y quedo asi...
Código Delphi [-]
var
  Lista: TList;
  f,i: Integer;
begin
with frmConeccion do
begin
  Guardar.SQL.Clear;
  Guardar.SQL.Text := 'select * from tabla where idtabla=:id';
  Guardar.Active := True;
  Guardar.Open;
  Guardar.Insert;
  Lista:= TList.Create;
  try
    frmPlantilla.ScrollB.GetTabOrderList(Lista);
    f:= 1;
    for i:= 0 to Lista.Count-1 do
    begin
      if TControl(Lista[i]) is TCustomEdit then
      begin
        if TCustomEdit(Lista[i]) is TEdit then
        begin
          Guardar.Fields[f].AsString:= TEdit(TCustomEdit(Lista[i])).Text;
          Inc(f);
        end;
        if TCustomEdit(Lista[i]) is TMemo then
        begin
          Guardar.Fields[f].AsString:= TMemo(TCustomEdit(Lista[i])).Lines.Text;
          Inc(f);
        end;
      end;
    end;
  finally
    Lista.Free;
  end;
  Guardar.Post;
  Guardar.Close;
  Guardar.Active := False;
  MessageBox(0, 'Registros Guardados correctamente', 'Mensaje', MB_ICONINFORMATION + MB_OK);
end;

con respecto a tu pegunta : ¿ Por que no usar TDBEdit y TDBMemo ?
uso TEdit y TMemo, porque todos los datos ingresados en estos se va ha guardar encriptado en la base de datos y para modificarlos se va ha desencriptar los datos y mostrar en Los Edit y Memo, y al usar TDBEdit y TDBMemo se me complica la vida.
Responder Con Cita