Ver Mensaje Individual
  #7  
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
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;  //para agregar los datos al grid como alquiler nuevo
end;

Alquiler = DBGRID
Edit1 = CLientes
Edit2 = Peliculas

gracias...

Última edición por enecumene fecha: 22-07-2006 a las 02:36:11.
Responder Con Cita