Ver Mensaje Individual
  #7  
Antiguo 28-08-2010
Avatar de afunez2007
afunez2007 afunez2007 is offline
Miembro
 
Registrado: oct 2007
Ubicación: La Ceiba, Honduras
Posts: 170
Reputación: 17
afunez2007 Va por buen camino
Lightbulb

Cita:
Empezado por microbiano Ver Mensaje
la verdad ya probe pasando el dato com tipo fecha y aun asi no lo acepta.

hice la prueba con la siguiente instruccion y funciona pero la verdad me queda duda del por que no puedo hacerlo con parametros.

Código Delphi [-]sql.Add('INSERT INTO VOLANTES ('); Sql.Add(' usuario,'); sql.Add(' recibe,'); sql.Add(' volante,'); sql.Add(' fecha_oficio'); sql.Add(' ) values ('); sql.Add(' '+QuotedStr(Fprincipal.wusuario)+', '); sql.Add(' '+QuotedStr(wrecibio)+', '); sql.Add(' '+QuotedStr(woficio)+', '); sql.Add(' '+QuotedStr(DateToStr(wfechaoficio))+')');
Ese es el problema de utilizar sql.add, a mi en lo particular me gusta mas el sql.text:

Código Delphi [-]
with fmodulo.qry_registra do
   begin
     sql.Text:='insert into volantes(usuario,recibe,volante,fecha_oficio)'
             +' values (:usuario,:recibe,:volante,:fecha_oficio)';
     Parameters.ParamByName('usuario').Value:=Trim(Fprincipal.wusuario);
     Parameters.ParamByName('recibe').Value:=wrecibio;
     Parameters.ParamByName('volante').Value:= woficio;
     Parameters.ParamByName('fecha_oficio').Value:= Fregistro.dtp_fecha_oficio.Date;
     try
      ExecSQL;
      application.MessageBox('Registro Almacenado Correctamente','',mb_ok + mb_iconinformation);
      exit;
     except
      on E:EOleException do
       begin
        //showmessage('Problemas con query ['+text+']');
        MessageDlg(Format('Error: %s    Codigo: %d', [E.Message, E.ErrorCode]), mtError, [mbOK], 0);
        exit;
       end; 
     end;
   end;
__________________
Si robas, roba un beso, si mientes que sea por amor y si engañas que sea a la muerte!!
Responder Con Cita