Автор работы: Пользователь скрыл имя, 30 Ноября 2010 в 22:19, Не определен
Курсовой проект
DBNavigator1: TDBNavigator;
Button1: TButton;
Button3: TButton;
Image1: TImage;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
w,tab: variant;
implementation
uses
Unit6;
{$R
*.dfm}
procedure TForm3.Button2Click(Sender: TObject);
begin
DataSource1.DataSet:=
case RadioGroup1.ItemIndex of
0:begin
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT * FROM uch_chast WHERE Kurs='+#39+Edit1.Text+#39);
Query1.Active:=True;
end;
1:begin
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT * FROM uch_chast WHERE Spez='+#39+Edit1.Text+#39);
Query1.Active:=True;
end;
2:begin
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT * FROM uch_chast WHERE Disz='+#39+Edit1.Text+#39);
Query1.Active:=True;
end;
3:begin
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT * FROM uch_chast WHERE Prepod='+#39+Edit1.Text+#39);
Query1.Active:=True;
end;
end;
end;
procedure TForm3.Button1Click(Sender: TObject);
var
i:integer;
begin
w:=CreateOleObject('
w.Visible:=true;
w.Documents.Add;
tab:=w.ActiveDocument.
tab.Autoformat
(Format:=31);
tab.columns.item(1).
tab.columns.item(2).
tab.columns.item(3).
tab.columns.item(4).
tab.columns.item(5).
tab.columns.item(6).
tab.columns.item(7).
tab.columns.item(8).
tab.columns.item(9).
tab.columns.item(10).
tab.columns.item(11).
tab.columns.item(12).
tab.columns.item(13).
tab.cell(1,1).range.
for i:=2 to 13 do
tab.cell(1,i).range.text:=
i:=2;
Query1.First;
while not(Query1.Eof) do
begin
tab.rows.add;
tab.cell(i,1).range.text:=
tab.cell(i,2).range.text:=
tab.cell(i,3).range.text:=
tab.cell(i,4).range.text:=
tab.cell(i,5).range.text:=
tab.cell(i,6).range.text:=
tab.cell(i,7).range.text:=
tab.cell(i,8).range.text:=
tab.cell(i,9).range.text:=
tab.cell(i,10).range.text:=
tab.cell(i,11).range.text:=
tab.cell(i,12).range.text:=
tab.cell(i,13).range.text:=
form3.Query1.Next;
i:=i+1;
end;
tab.rows.item(i).
end;
procedure TForm3.Button3Click(Sender: TObject);
begin
DataSource1.DataSet:=
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT * FROM Student');
Query1.Active:=True;
end;
end.
Программный код формы
4:
unit Unit5;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, jpeg, ExtCtrls;
type
TForm5 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
{$R *.dfm}
procedure TForm5.Button1Click(Sender: TObject);
begin
Close;
end;
end.
Программный код формы № 5
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables, StdCtrls, ComObj,
jpeg ;
type
TForm6 = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBNavigator2: TDBNavigator;
RadioGroup1: TRadioGroup;
Edit1: TEdit;
Button2: TButton;
Query1: TQuery;
Button3: TButton;
Image1: TImage;
Button1: TButton;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
w,tab: variant;
implementation
{$R *.dfm}
procedure TForm6.Button2Click(Sender: TObject);
begin
DataSource1.DataSet:=
case RadioGroup1.ItemIndex of
0:begin
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT * FROM otdel_kadr WHERE Fam='+#39+Edit1.Text+#39);
Query1.Active:=True;
end;
1:begin
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT * FROM otdel_kadr WHERE Obuchen='+#39+Edit1.Text+#39);
Query1.Active:=True;
end;
end;
end;
procedure TForm6.Button1Click(Sender: TObject);
var
i:integer;
begin
w:=CreateOleObject('
w.Visible:=true;
w.Documents.Add;
tab:=w.ActiveDocument.
tab.Autoformat (Format:=31);
tab.columns.item(1).
tab.columns.item(2).
tab.columns.item(3).
tab.columns.item(4).
tab.columns.item(5).
tab.columns.item(6).
tab.columns.item(7).
tab.columns.item(8).
Информация о работе Сущность проектируемой автоматизированной системы