Einzelnen Beitrag anzeigen

question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#1

check username/password

  Alt 28. Okt 2013, 10:01
hi,
I have a table called "userdata" which contains (username, password)
I have a window in Delphi with two edit fields username and password and one button "Login"
After typing username and password, when I click on "Login" button, I would like to check whether username and password is match or not
I have tried with following code but it is not working
Code:
procedure TForm1.Checkuserdata(Sender: TObject);
begin
  Table.Open;
  Table.First;
  while not Table.Eof do begin
    if (Edit1.Text = Table.FieldByName('username').AsString) and
   (Edit2.Text = Table.FieldByName('password').AsString)
   then
       Showmessage('match the user data');
       exit;
    end;
  Mit Zitat antworten Zitat