Ver Mensaje Individual
  #1  
Antiguo 22-07-2006
Avatar de enecumene
[enecumene] enecumene is offline
Miembro de Oro
 
Registrado: may 2006
Ubicación: Santo Domingo, Rep. Dom.
Posts: 3.040
Reputación: 24
enecumene Va por buen camino
gracias lepe pro tu respuesta, asi quedo mi codigo con tus recomendaciones:

Código Delphi [-]
procedure TAlquiler.Edit2KeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then begin
  Modulo.qryPelicula.SQL.Clear;
  Modulo.qryPelicula.Close;
  Modulo.qryPelicula.SQL.Add('SELECT codbarra, titulo_pelicula FROM tbPelicula');
  Modulo.qryPelicula.SQL.Add('WHERE codbarra = '+quotedstr(Edit2.Text) );
  Modulo.qryPelicula.Open;
  if not Modulo.qryPelicula.IsEmpty then begin
    DBText2.Caption:=Modulo.qryPelicula.fieldByName('titulo_pelicula').AsString;
    end
  else
    begin
    ShowMessage('Pelicula no existe');
    end;
  end;
If (Trim(Edit1.Text)<> EmptyStr) and (Trim(Edit2.Text) <> EmptyStr) then
Modulo.qryAlquiler.SQL.Add('SELECT * FROM tbPeliculaAlquilada WHERE telefono1_cliente = " & Edit1');
Alquiler.DataSource := Modulo.dsAlquiler;
Alquiler.Refresh;
   If Trim(Edit1.Text) = EmptyStr Then Edit1.SetFocus;
   If Trim(Edit2.Text) = EmptyStr Then Edit2.SetFocus;
end;

pero sucede que no pasa nada no se me agrega al grid..

gracias:::
Responder Con Cita