Ver Mensaje Individual
  #1  
Antiguo 04-10-2013
diablo66 diablo66 is offline
Registrado
NULL
 
Registrado: oct 2013
Posts: 2
Reputación: 0
diablo66 Va por buen camino
uso de comillas

serian tan amables de explicarme en este código el uso de comillas ya que yo uso parámetros para hacer lo mismo que hace este código
Código Delphi [-]
            with query do begin
            Close;
            SQL.Clear;
            SQL.Add('UPDATE categorias SET nombre = ''' + txtCategoria.Text + ''',');
            SQL.Add('cuenta = ''' + txtClave.Text + ''',');
            SQL.Add('fecha_umov = ''' + FormatDateTime(Formato_Fecha,Date) + '''');//'mm/dd/yyyy'
            SQL.Add('WHERE clave = ' + IntToStr(iClave));
            ExecSQL;
            Close;
        end;

general mente lo escribo asi
Código Delphi [-]
 AdoQuery:=TADOQuery.Create(nil);

   try

    AdoQuery.Connection:=ADOconection1;
    AdoQuery.SQL.Add('SELECT fecha,P_Id  FROM total WHERE fecha=:fecha and P_Id=:P_Id2');
    AdoQuery.Parameters.ParamByName('fecha').Value := fecha;
    AdoQuery.Parameters.ParamByName('P_Id2').Value := P_Id;
    AdoQuery.Prepared;
    AdoQuery.Open;
    AdoQuery.First;
Responder Con Cita