Ver Mensaje Individual
  #9  
Antiguo 17-04-2008
Avatar de ContraVeneno
ContraVeneno ContraVeneno is offline
Miembro
 
Registrado: may 2005
Ubicación: Torreón, México
Posts: 4.738
Reputación: 23
ContraVeneno Va por buen camino
Para asignar el valor al campo en la base de datos, es prácticamente lo mismo:

Código Delphi [-]
with UnDataModule.UnQuery do begin
 If active then close;
 SQL.Clear;
 SQL.Add('Update UnaTabla');
 SQL.Add('Set Total = :vTotal');
 SQL.Add('Where UnRegistro = :pUnRegistro');
 Parameters.ParamByname('vTotal').AsCurrency := vTot_Brut.AsCurrency;
 Parameters.ParamByName('pUnRegistro').AsString := IDRegistro.AsString;
 ExecSQL;
end; //with
.... //o para un Insert:
with UnDataModule.UnQuery do begin
 If active then close;
 SQL.Clear;
 SQL.Add('Insert into UnaTabla(IDRegistro, Total)');
 SQL.Add('Values(:vUnRegistro, :vTotal');
 Parameters.ParamByname('vTotal').AsCurrency := vTot_Brut.AsCurrency;
 Parameters.ParamByName('vUnRegistro').AsString := IDRegistro.AsString;
 ExecSQL;
end; //with
__________________


Última edición por ContraVeneno fecha: 18-04-2008 a las 00:00:51.
Responder Con Cita