Advertisement
Guest User

s

a guest
Apr 5th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7. Dialogs,Unit2, StdCtrls,Unit3, DB, ADODB;
  8.  
  9. type
  10. TForm1 = class(TForm)
  11. Button1: TButton;
  12. Label1: TLabel;
  13. Label2: TLabel;
  14. Edit1: TEdit;
  15. Edit2: TEdit;
  16. ADOQuery1: TADOQuery;
  17. procedure Button1Click(Sender: TObject);
  18. private
  19. { Private declarations }
  20. public
  21. { Public declarations }
  22. end;
  23.  
  24. var
  25. Form1: TForm1;
  26. var
  27. Form2:TForm2;
  28. implementation
  29.  
  30. {$R *.dfm}
  31.  
  32. procedure TForm1.Button1Click(Sender: TObject);
  33. begin
  34. Unit2.Form2.Show;
  35. ADOQuery1.SQL.Clear;
  36. ADOQuery1.SQL.Text:= 'SELECT* from Users where UserName=:username and password=:password';
  37. ADOQuery1.Parameters.ParamByName('username').Value:=Edit1.Text;
  38. ADOQuery1.Parameters.ParamByName('password').Value:=Edit2.Text;
  39. ADOQuery1.Open;
  40. if not ADOQuery1.isEmpty then
  41. showmessage('Success')
  42. else
  43. showmessage('Fail')
  44.  
  45. //showmessage('Welcome!');
  46. end;
  47.  
  48. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement