📄 unit13.pas
字号:
unit Unit13;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, DBGrids;
type
TForm13 = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Edit1: TEdit;
Button1: TButton;
DBGrid1: TDBGrid;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form13: TForm13;
pass:string;
implementation
uses unit6;
{$R *.dfm}
procedure TForm13.Button1Click(Sender: TObject);
begin
with data.ADOQuery2 do
begin
close;
sql.Clear;
sql.Add('insert into 选课表');
sql.Add('values ('''+Edit1.Text+''','''+pass+''')');
execsql;
with data.ADOQuery1 do
begin
close;
sql.Clear;
sql.Add('select * from 选课表');
sql.Add('where 学生学号='''+pass+'''');
execsql;
end
end
end;
procedure TForm13.Button2Click(Sender: TObject);
begin
with data.ADOQuery2 do
begin
close;
sql.Clear;
sql.Add('delete from 选课表');
sql.Add('where 课程号='''+edit1.Text+'''');
execsql;
with data.ADOQuery1 do
begin
close;
sql.Clear;
sql.Add('select * from 选课表');
sql.Add('where 学生学号='''+pass+'''');
execsql;
end
end
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -