?? unit12.~pas
字號:
unit Unit12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, DB, ADODB, jpeg, ExtCtrls;
type
TForm12 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Button1: TButton;
ADOQuery1: TADOQuery;
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form12: TForm12;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm12.Button1Click(Sender: TObject);
var username,password:string;
begin
username:=edit1.Text;
password:=edit2.Text;
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * from admin where 用戶名='''+edit1.Text+''' and 密碼='''+edit2.Text+'''');
adoquery1.Open;
if (edit1.Text='') or (edit2.Text='') then
showmessage('輸入的用戶名或密碼不能為空')
else if adoquery1.Recordset.RecordCount=0 then
begin
showmessage('用戶名或密碼輸入錯誤');
end
else begin
Form1.showmodal;
Form12.Close;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -