Cita:
Empezado por Casimiro Notevi
Pon el código que lo veamos
|
Aqui esta mi codigo lo ejecuto un boton "aceptar"
Código Delphi
[-]procedure TForm1.IniciarClick(Sender: TObject);
begin
with datamodule2 do
begin
ql.SQL.Text:='Select idEmpleados, Password, AreaTrab from empleados where AreaTrab=:"box" and idEmpleados=:log and Password=:"pass"';
ql.Parameters.ParamByName('log').Value:=Edit1.Text;
ql.Parameters.ParamByName('pass').Value:=Edit2.Text;
ql.Parameters.ParamByName('box').Value:=Box.Text;
ql.Open;
if ql.RecordCount=1 then
begin
ShowMessage('BIENVENIDO');
Form1.hide;
if box.Text= 'Medicina' then Form3.Show;
if box.Text= 'Farmacia' then Form7.Show;
if box.Text= 'Administrativo' then Form8.Show;
end
else
begin
ShowMessage('Error en usuario y/o contraseña');
e:=e+1;
end;
if e=3 then
begin
Button2.Click;
end;
edit2.Text:='';
end;