a ver, despues de mucho leer y leer por ahi, he intentado hacer este codigo para agregar el alquiler al grid, pero que va de nada me sirve, aqui os pongo el codigo, a ver que es lo que esta mal:
Código Delphi
[-]procedure TAlquiler.Edit2KeyPress(Sender: TObject; var Key: Char);
var ISQL : string;
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 Edit1.Text<> ' ' and Edit2.Text<> ' ' Then
ISQL = Modulo.qryAlquiler.SQL.Add('SELECT * FROM tbPeliculaAlquilada WHERE telefono1_cliente = " & Edit1');
Alquiler.DataSource = ISQL;
Alquiler.Refresh;
Else
If Edit1 = " " Then Edit1.SetFocus;
If Edit2 = " " Then Edit2.SetFocus;
End;
End; end;
Alquiler = DBGRID
Edit1 = CLientes
Edit2 = Peliculas
gracias...