Ver Mensaje Individual
  #5  
Antiguo 22-03-2010
[maeyanes] maeyanes is offline
Capo de los Capos
 
Registrado: may 2003
Ubicación: Campeche, México
Posts: 2.732
Reputación: 26
maeyanes Va por buen camino
Hola...

Yo lo haría así:

Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
begin
  Query1.sql.text:= 'Select Clave,nombre,domicilio from Usuarios where Clave = :Cla';
  Query1.Parameters[0].Value := Edit1.Text;
  Query1.Open;
  if not Query1.IsEmpty then
  begin
    Edit2.text:= Query1.filebyname('nombre').AsString;
    Edit3.text:= Query1.filebyname('domicilio').AsString
  end
  else
  begin
    MessageDlg('Clave Inválida',mtError, [mbOK], 0);
    Edit1.Text := '';
    Edit1.SetFocus
  end;
  Query1.Active := False;
end;
Responder Con Cita