?? unit7.pas
字號:
unit Unit7;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DBCtrls, DB, DBTables, StdCtrls,Unit4;
type
TFormFChPwd = class(TForm)
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
Label3: TLabel;
Edit2: TEdit;
Button1: TButton;
Table1: TTable;
Query1: TQuery;
DataSource1: TDataSource;
DBLookupComboBox1: TDBLookupComboBox;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormFChPwd: TFormFChPwd;
implementation
{$R *.dfm}
procedure TFormFChPwd.Button1Click(Sender: TObject);
var
id:string;
begin
if DBLookupComboBox1.Text='' then
begin
ShowMessage('請選擇學生');
Exit;
end;
id:=Table1.Lookup('姓名',DBLookupComboBox1.Text,'學號');
if Edit1.Text<>Edit2.Text then
begin
ShowMessage('兩個密碼不相同 ');
Exit;
end
else
begin
Query1.SQL.Text:='Update 密碼.db set 密碼= '''+Edit1.Text
+''' where 學號='''+ id +'''';
Query1.ExecSQL;
ShowMessage('修改成功');
Edit1.Text:='';
Edit2.Text:='';
FormFChPwd.Close;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -