unit UnitAdmin2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Mask, UnitLogin2;
type
TFormAdmin2 =
class(TForm)
Label1: TLabel;
Label2: TLabel;
edUser: TEdit;
mePW: TMaskEdit;
btOK: TButton;
procedure btOKClick(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
function isOK: boolean;
end;
var
FormAdmin2: TFormAdmin2;
ok: integer;
implementation
{$R *.dfm}
{ TFormAdmin2 }
function TFormAdmin2.isOK: boolean;
begin
if ( ok = 1 )
then
result := true
else
result := false;
end;
procedure TFormAdmin2.btOKClick(Sender: TObject);
var user,pw:
string;
begin
user := edUser.Text;
pw := mePW.Text;
UnitLogin2.FormLogin2.Table1.Active := false;
UnitLogin2.FormLogin2.Table1.Filtered := false;
UnitLogin2.FormLogin2.Table1.Filter := '
User = '+QuotedStr( user );
UnitLogin2.FormLogin2.Table1.Filtered := true;
UnitLogin2.FormLogin2.Table1.Open;
if (pw = UnitLogin2.FormLogin2.dbePW.Text)
then
showmessage('
klappt')
else
showmessage('
klappt nicht');
end;
end.