Ver Mensaje Individual
  #10  
Antiguo 11-08-2019
donpedro donpedro is offline
Miembro
 
Registrado: nov 2009
Posts: 102
Reputación: 0
donpedro cantidad desconocida en este momento
Me he llevado de sus sugerencias. He creado un procedimiento aparte. Coloco el codigo para ver si lo hice correctamente

Código Delphi [-]
procedure Tfrmlogin.acceso();
 begin

(* Con este codigo validamos y verificamos si el usuario introduce correctamente
   los datos para logearse en el sistema. Tambien si el usuario introduce tres veces
   los datos incorrectos el sistema automaticamente se cerrara *)

        With Qlogin do
    begin
        close;
        SQL.Clear;
        SQL.Add('SELECT * FROM EMPLEADOS, PERFILES WHERE USERNAME = ' + '''' + DBusuario.Text + '''');
        SQL.Add('AND CLAVE='+''''+DBclave.Text+'''');
        Open;
            if (RecordCount > 0) AND (FieldByName('estado').AsString='A')  then
        begin
                with Frmprincipal do
            begin
                Barraestado.panels[0].Text:=fieldbyname('username').asstring +'     '+'('+fieldbyname('nombres').AsString +')';
                Barraestado.panels[1].Text:=fieldbyname('perfil').asstring;
                Barraestado.panels[2].Text:=fieldbyname('numero doc').asstring;
                id.Caption:=fieldbyname('id perfil').AsString;
            end;
                Frmlogin.Hide;
                Frmprincipal.Show;
                COUNT:=0;
        end
          else
          begin
                count:=count+1;
                MESSAGEDLG('NO TIENE ACCESO, DATOS INCORRECTOS / USUARIO INACTIVO O RETIRADO',MTERROR,[MBOK],0);
                DBusuario.Clear;
                DBclave.Clear;
                DBusuario.SetFocus;
          end;
                if COUNT=3 then
                    if MESSAGEDLG(INTTOSTR(COUNT)+ ' ' + 'INTENTOS ERRONEOS, EL SISTEMA SE CERRARA POR MOTIVOS DE SEGURIDAD.',MTERROR,[MBOK],0)=MrOk then
                    Application.Terminate;
    end;

 end;

Gracias por la ayuda brindada
Responder Con Cita