Автор: Пользователь скрыл имя, 23 Сентября 2012 в 21:53, курсовая работа
Для разработки данной базы была выбрана среда разработки приложений Delphi. В программном продукте использовалась технология ADO - способ взаимодействия приложения, созданного в среде разработки Delphi, и базы данных. Объекты базы данных в Delphi основаны на SQL- языке.
Целью данной практики является разработка базы данных Библиотека.
Введение 3
Аналитическая часть 4
1.1 Этап концептуального проектирования 4
1.1.1 Описание предметной области 4
1.1.2 Характеристика предметной области 5
1.1.3 Ограничения и допущения предметной области 6
1.1.4 Модель «Сущность-связь» (ER-диаграмма) 7
1.2 Этап логического проектирования 8
1.2.1 Обоснование выбора модели данных 8
1.2.2 Реляционная модель предметной области 8
1.2.3 Нормализация отношений 9
1.2.4 Логическая модель данных предметной области 11
1.3 Обоснование выбора системы управления базами данных 12
Проектная часть 14
2.1 Назначение и цель создания 14
2.2 Требования к системе 14
2.3 Руководство к использованию и эксплуатации 14
2.3.1 Инсталлятор 14
2.3.2 Главная форма 15
2.3.3 Таблицы 16
2.3.4 Запросы 17
2.3.5 Отчеты 23
2.3.6 Помощь 24
Заключение 26
Список используемой литературы 27
6
6
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, ComCtrls, StdCtrls, Menus,
Buttons;
type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
N1: TMenuItem;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
Label8: TLabel;
Label9: TLabel;
DBGrid1: TDBGrid;
DBNavigator1: TDBNavigator;
Edit8: TEdit;
Edit9: TEdit;
TabSheet2: TTabSheet;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
DBGrid2: TDBGrid;
DBNavigator2: TDBNavigator;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
TabSheet3: TTabSheet;
Label3: TLabel;
Label4: TLabel;
DBGrid3: TDBGrid;
DBNavigator3: TDBNavigator;
Edit3: TEdit;
Edit4: TEdit;
TabSheet4: TTabSheet;
Label1: TLabel;
Label2: TLabel;
DBGrid4: TDBGrid;
DBNavigator4: TDBNavigator;
Edit2: TEdit;
Edit1: TEdit;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N11: TMenuItem;
N21: TMenuItem;
N31: TMenuItem;
N41: TMenuItem;
N51: TMenuItem;
N61: TMenuItem;
procedure Edit1Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
procedure Edit3Change(Sender: TObject);
procedure Edit4Change(Sender: TObject);
procedure Edit5Change(Sender: TObject);
procedure Edit6Change(Sender: TObject);
procedure Edit7Change(Sender: TObject);
procedure Edit8Change(Sender: TObject);
procedure Edit9Change(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N11Click(Sender: TObject);
procedure N21Click(Sender: TObject);
procedure N31Click(Sender: TObject);
procedure N41Click(Sender: TObject);
procedure N51Click(Sender: TObject);
procedure N61Click(Sender: TObject);
procedure N71Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2, Unit3,DB, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9, Unit10,
Unit11;
{$R *.dfm}
procedure TForm1.Edit1Change(Sender: TObject);
begin
if edit1.Text<>'' then
DM.ADOTable4.Locate('kod_kl',
end;
procedure TForm1.Edit2Change(Sender: TObject);
begin
if edit2.Text<>'' then
DM.ADOTable4.Locate('sum_vozr'
end;
procedure TForm1.Edit3Change(Sender: TObject);
begin
if edit3.Text<>'' then
DM.ADOTable3.Locate('kod_film'
end;
procedure TForm1.Edit4Change(Sender: TObject);
begin
if edit4.Text<>'' then
DM.ADOTable3.Locate('number',
end;
procedure TForm1.Edit5Change(Sender: TObject);
begin
if edit5.Text<>'' then
DM.ADOTable2.Locate('name_
end;
procedure TForm1.Edit6Change(Sender: TObject);
begin
if edit6.Text<>'' then
DM.ADOTable2.Locate('kod_film'
end;
procedure TForm1.Edit7Change(Sender: TObject);
begin
if edit7.Text<>'' then
DM.ADOTable2.Locate('data_vip'
end;
procedure TForm1.Edit8Change(Sender: TObject);
begin
if edit8.Text<>'' then
DM.ADOTable1.Locate('FIO',
end;
procedure TForm1.Edit9Change(Sender: TObject);
begin
if edit9.Text<>'' then
DM.ADOTable1.Locate('adres',
end;
procedure TForm1.N2Click(Sender: TObject);
begin
Form1.Visible:=false;
Form3.show;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Form1.Visible:=false;
Form4.show;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
Form1.Visible:=false;
Form3.show;
end;
procedure TForm1.N6Click(Sender: TObject);
begin
Form1.close;
Form4.Close;
Form3.Close;
end;
procedure TForm1.N5Click(Sender: TObject);
begin
Form1.Visible:=false;
Form4.show;
end;
procedure TForm1.N3Click(Sender: TObject);
begin
Form1.Visible:=false;
Form3.show;
end;
procedure TForm1.N11Click(Sender: TObject);
begin
form5.QuickRep1.Preview;
end;
procedure TForm1.N21Click(Sender: TObject);
begin
form5.QuickRep1.Preview;
end;
procedure TForm1.N31Click(Sender: TObject);
begin
Form7.QuickRep1.Preview;
end;
procedure TForm1.N41Click(Sender: TObject);
begin
Form8.QuickRep1.Preview;
end;
procedure TForm1.N51Click(Sender: TObject);
begin
Form9.QuickRep1.Preview;
end;
procedure TForm1.N61Click(Sender: TObject);
begin
Form10.QuickRep1.Preview;
end;
procedure TForm1.N71Click(Sender: TObject);
begin
Form11.QuickRep1.Preview;
end;
end.
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, Grids, DBGrids, StdCtrls, Buttons, Menus;
type
TForm3 = class(TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
BitBtn2: TBitBtn;
TabSheet2: TTabSheet;
DBGrid1: TDBGrid;
DBGrid2: TDBGrid;
BitBtn4: TBitBtn;
TabSheet3: TTabSheet;
DBGrid3: TDBGrid;
Button1: TButton;
Edit1: TEdit;
BitBtn5: TBitBtn;
BitBtn6: TBitBtn;
Label1: TLabel;
TabSheet4: TTabSheet;
DBGrid4: TDBGrid;
BitBtn7: TBitBtn;
BitBtn8: TBitBtn;
Edit2: TEdit;
Label2: TLabel;
Button2: TButton;
BitBtn1: TBitBtn;
BitBtn3: TBitBtn;
BitBtn9: TBitBtn;
TabSheet5: TTabSheet;
DBGrid5: TDBGrid;
BitBtn10: TBitBtn;
MEMO1: TMemo;
BitBtn11: TBitBtn;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure BitBtn5Click(Sender: TObject);
procedure BitBtn6Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure BitBtn9Click(Sender: TObject);
procedure BitBtn10Click(Sender: TObject);
procedure BitBtn11Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N7Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses Unit1, Unit2, Unit4, Unit11, Unit10, Unit5, Unit6, Unit7, Unit8,
Unit9, Unit12;
{$R *.dfm}
procedure TForm3.BitBtn1Click(Sender: TObject);
begin
Form3.Visible:=false;
Form1.show;
end;
procedure TForm3.BitBtn2Click(Sender: TObject);
begin
Form3.Visible:=false;
Form4.show;
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
with DM.ADOQuery3 do begin
close;
parameters[0].value:=edit1.
open;
end;
end;
procedure TForm3.BitBtn5Click(Sender: TObject);
begin
Form3.Visible:=false;
Form4.show;
end;
procedure TForm3.BitBtn6Click(Sender: TObject);
begin
Form3.Visible:=false;
Form1.show;
end;
procedure TForm3.Button2Click(Sender: TObject);
begin
with DM.ADOQuery4 do begin
close;
parameters[0].value:=edit2.
open;
end;
end;
procedure TForm3.BitBtn9Click(Sender: TObject);
begin
Form11.QuickRep1.Preview;
end;
procedure TForm3.BitBtn10Click(Sender: TObject);
begin
Dm.ADOQuery5.Close;
Dm.ADOQuery5.SQL.Clear;
Dm.ADOQuery5.SQL.Add(MEMO1.
Dm.ADOQuery5.Open;
end;
procedure TForm3.BitBtn11Click(Sender: TObject);
begin
Form12.QuickRep1.Preview;
end;
procedure TForm3.N2Click(Sender: TObject);
begin
form5.QuickRep1.Preview;
end;
procedure TForm3.N3Click(Sender: TObject);
begin
form6.QuickRep1.Preview;
end;
procedure TForm3.N4Click(Sender: TObject);
begin
form8.QuickRep1.Preview;
end;
procedure TForm3.N5Click(Sender: TObject);
begin
form7.QuickRep1.Preview;
end;
procedure TForm3.N6Click(Sender: TObject);
begin
form9.QuickRep1.Preview;
end;
procedure TForm3.N7Click(Sender: TObject);
begin
form10.QuickRep1.Preview;
end;
end.
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TForm4 = class(TForm)
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
BitBtn3: TBitBtn;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn3Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
uses Unit1, Unit2, Unit3, Unit5;
{$R *.dfm}
procedure TForm4.BitBtn1Click(Sender: TObject);
begin
Form4.Close;
end;
procedure TForm4.BitBtn2Click(Sender: TObject);
begin
Form4.Visible:=false;
Form1.show;
end;
procedure TForm4.BitBtn3Click(Sender: TObject);
begin
Form4.Visible:=false;
Form3.show;
end;
procedure TForm4.BitBtn4Click(Sender: TObject);
begin
Form4.Visible:=false;
form5.QuickRep1.Preview;
end;
end.
unit Unit5;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, QuickRpt, QRCtrls;
type
TForm5 = class(TForm)
QuickRep1: TQuickRep;
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRLabel4: TQRLabel;
QRDBText3: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
uses Unit1, Unit2, Unit3, Unit4;
{$R *.dfm}
end.
unit Unit6;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QuickRpt, ExtCtrls, QRCtrls;
type
TForm6 = class(TForm)
QuickRep1: TQuickRep;
TitleBand1: TQRBand;
ColumnHeaderBand1: TQRBand;
DetailBand1: TQRBand;
QRLabel1: TQRLabel;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
QRDBText9: TQRDBText;
QRLabel10: TQRLabel;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form6: TForm6;
implementation
uses Unit1, Unit2, Unit3, Unit4, Unit5;
{$R *.dfm}
end.
unit Unit7;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
TForm7 = class(TForm)
QuickRep1: TQuickRep;
QRBand1: TQRBand;
ColumnHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel10: TQRLabel;
QRLabel1: TQRLabel;
DetailBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form7: TForm7;
implementation
uses Unit1, Unit2, Unit3, Unit4, Unit5, Unit6;
{$R *.dfm}
end.
unit Unit8;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
TForm8 = class(TForm)
QuickRep1: TQuickRep;
QRBand1: TQRBand;
QRLabel1: TQRLabel;
ColumnHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
QRLabel10: TQRLabel;
DetailBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRLabel8: TQRLabel;
QRDBText7: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form8: TForm8;
implementation
uses Unit1, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7;
{$R *.dfm}
end.
unit Unit9;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
TForm9 = class(TForm)
QuickRep1: TQuickRep;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
ColumnHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
DetailBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form9: TForm9;
implementation
uses Unit1, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8;
{$R *.dfm}
end.
unit Unit10;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
TForm10 = class(TForm)
QuickRep1: TQuickRep;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
ColumnHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
DetailBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRLabel9: TQRLabel;
QRDBText8: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form10: TForm10;
implementation
uses Unit1, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9;
{$R *.dfm}
end.
unit Unit11;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, QRCtrls, QuickRpt, ExtCtrls;
type
TForm11 = class(TForm)
QuickRep1: TQuickRep;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
ColumnHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
DetailBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRLabel10: TQRLabel;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
QRDBText9: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form11: TForm11;
implementation
uses Unit1, Unit10, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit9;
{$R *.dfm}
end.
unit Unit12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, QuickRpt, QRCtrls;
type
TForm12 = class(TForm)
QuickRep1: TQuickRep;
TitleBand1: TQRBand;
QRLabel1: TQRLabel;
ColumnHeaderBand1: TQRBand;
QRLabel2: TQRLabel;
QRLabel3: TQRLabel;
QRLabel4: TQRLabel;
DetailBand1: TQRBand;
QRDBText1: TQRDBText;
QRDBText2: TQRDBText;
QRDBText3: TQRDBText;
QRLabel5: TQRLabel;
QRLabel6: TQRLabel;
QRLabel7: TQRLabel;
QRLabel8: TQRLabel;
QRLabel9: TQRLabel;
QRDBText4: TQRDBText;
QRDBText5: TQRDBText;
QRDBText6: TQRDBText;
QRDBText7: TQRDBText;
QRDBText8: TQRDBText;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form12: TForm12;
implementation
uses Unit1, Unit10, Unit11, Unit2, Unit3, Unit4, Unit5, Unit6, Unit7,
Unit8, Unit9;
{$R *.dfm}
end.