Mega Code Archive
Ado ile ufak bir şifre kontrol
//sercom-bilgisayar@hotmail.com
procedure TSifreForm.tamamClick(Sender: TObject);
var
GirisPassword: String;
begin
If Self.kullaniciadi.Text = '' Then Begin
Application.MessageBox('Kullanıcı adını boş geçemezsiniz...','Hata!!!');
kullaniciadi.SetFocus;
Exit;
End;
AdoQuery1.SQL.Text := 'SELECT * FROM personel WHERE adi='''+Trim(kullaniciadi.Text)+'''';
AdoQuery1.Open;
GirisPassword := Trim(AdoQuery1.FieldByName('sifre').AsString);
If AdoQuery1.RecordCount = 0 Then Begin
Application.MessageBox('Böyle bir kullanıcı kayıtlı değildir...','Hata!!!');
AdoQuery1.Close;
Exit;
End Else Begin
If GirisPassword = password.Text Then Begin
AnaMenu.Enabled := True;
SifreForm.Visible := False;
End Else Begin
Application.MessageBox('Şifre hatalı lütfen tekrar deneyiniz...','Hata!!!');
End;
End;
AdoQuery1.Close;
end;