Ver Mensaje Individual
  #4  
Antiguo 11-11-2009
Avatar de ContraVeneno
ContraVeneno ContraVeneno is offline
Miembro
 
Registrado: may 2005
Ubicación: Torreón, México
Posts: 4.738
Reputación: 24
ContraVeneno Va por buen camino
yo te recomendaría utilizar parametros, de esa forma no te tienes que preocupar por hacer conversiones de fechas a texto o viceversa, ni tampo te preocupas por el formato de la fecha o por las comillas:

Código Delphi [-]
with UnADOQuery do begin 
 If active then close; 
 SQL.Clear; 
 SQL.Add('Insert Into Tabla(Numero, Nombre, Fecha)'); 
 SQL.Add('Values(:Numero, :Nombre, :Fecha)'); 
 with Parameters do begin  
  ParamByName('Numero').Value := UnNumero.AsInteger; //asFloat, asCurrency, etc  
  ParamByName('Nombre').Value := UnTexto.AsString;  
  ParamByName('Fecha').Value := UnDateTimePicker.Date; 
 end; //parameters 
 ExecSQL;
end; //with



Y por cierto, sería mucho mejor utilizar un TADOQuery que un TQUery
__________________

Responder Con Cita