Вопрос таков как встроить сюда что бы при нажатии на кнопку открывалась Form2. Все подключено. И в базе access логин и пароль задан!
При входе выкидывает с проги!
Код:
procedure TUserForm.Button1Click(Sender: TObject);
begin
If (LoginEdit.Text<>'') and (PasswordEdit.Text<>'') then //поля не пустые
begin
UserQuery.Active:=false;
UserQuery.Parameters.ParamByName('log').Value:=LoginEdit.Text;
UserQuery.Active:=true;
If UserQuery.RecordCount<>0 then
begin
If UserQuery.FieldByName('Пароль').AsString=PasswordEdit.Text then begin
login:=LowerCase(LoginEdit.Text);
If UserQuery.FieldByName('Доступ').AsString='True' then Dostup:=true//есть доступ
else Dostup:=false;
Close;
end
else Showmessage('Пароль неверный!');
end;
end
else ShowMessage('Введите имя пользователя и пароль!');//пустые поля
end;