Смекни!
smekni.com

Разработка приложения, представляющего собой базу данных о сотрудниках (стр. 6 из 8)

table5. Active: =true;

Table9. ConnectionString: ='Provider=Microsoft. Jet. OLEDB.4.0; Data Source='+getcurrentdir+'\Саша. mdb '; // связывает форму "ВУС" с базой данных, таблицей ""

table9. Active: =true;

Table10. ConnectionString: ='Provider=Microsoft. Jet. OLEDB.4.0; Data Source='+getcurrentdir+'\Саша. mdb '; // связывает форму "ВУС" с базой данных, таблицей ""

table10. Active: =true;

Table11. ConnectionString: ='Provider=Microsoft. Jet. OLEDB.4.0; Data Source='+getcurrentdir+'\Саша. mdb '; // связывает форму "ВУС" с базой данных, таблицей ""

table11. Active: =true;

table5. insert;

end; end.

unit Unit7;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, DB, ADODB, Grids, DBGrids, ExtCtrls, StdCtrls, DBCtrls, ImgList;

type

TForm7 = class(TForm)

DBGrid1: TDBGrid; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit;

Edit5: TEdit; Edit6: TEdit; Edit7: TEdit; Edit8: TEdit; Edit9: TEdit;

Edit10: TEdit; Edit11: TEdit; Edit12: TEdit; Panel1: TPanel; Button1: TButton; Button2: TButton; ADOQuery1: TADOQuery; Label1: TLabel;

Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel;

Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel;

Label10: TLabel; Label11: TLabel; Label12: TLabel; DataSource1: TDataSource; Button4: TButton; DBNavigator1: TDBNavigator;

Button3: TButton; Button5: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject);

procedure Button4Click(Sender: TObject); procedure Button5Click(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char);

procedure Edit2KeyPress(Sender: TObject; var Key: Char);

procedure Edit3KeyPress(Sender: TObject; var Key: Char);

procedure Edit11KeyPress(Sender: TObject; var Key: Char);

procedure Button3Click(Sender: TObject);

procedure Edit4KeyPress(Sender: TObject; var Key: Char);

procedure Edit5KeyPress(Sender: TObject; var Key: Char);

procedure Edit7KeyPress(Sender: TObject; var Key: Char);

procedure Edit8KeyPress(Sender: TObject; var Key: Char);

procedure Edit10KeyPress(Sender: TObject; var Key: Char);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form7: TForm7;

implementation

uses Unit9, Unit10;

{$R *. dfm}

procedure TForm7. Button1Click(Sender: TObject);

begin

if (edit1. text='') and (edit2. text='') and (edit3. text='') and (edit4. text='') and (edit5. text='') and (edit6. text='') and (edit7. text='') and (edit8. text='') and (edit9. text='') and (edit10. text='') and (edit11. text='') and (edit12. text='') then Showmessage('Вы не внесли критерии поиска')

else

Begin

adoquery1. Parameters. ParamByName('p1'). Value: ='%'+edit1. text+'%';

adoquery1. Parameters. ParamByName('p2'). Value: ='%'+edit2. text+'%';

adoquery1. Parameters. ParamByName('p3'). Value: ='%'+edit3. text+'%';

adoquery1. Parameters. ParamByName('p4'). Value: ='%'+edit4. text+'%';

adoquery1. Parameters. ParamByName('p5'). Value: ='%'+edit5. text+'%';

adoquery1. Parameters. ParamByName('p6'). Value: ='%'+edit6. text+'%';

adoquery1. Parameters. ParamByName('p7'). Value: ='%'+edit7. text+'%';

adoquery1. Parameters. ParamByName('p8'). Value: ='%'+edit8. text+'%';

adoquery1. Parameters. ParamByName('p9'). Value: ='%'+edit9. text+'%';

adoquery1. Parameters. ParamByName('p10'). Value: ='%'+edit10. text+'%';

adoquery1. Parameters. ParamByName('p11'). Value: ='%'+edit11. text+'%';

adoquery1. Parameters. ParamByName('p12'). Value: ='%'+edit12. text+'%';

ADOQuery1. Active: = True;

end; end;

procedure TForm7. Button2Click(Sender: TObject);

begin

Form9. QuickRep1. Preview;

end;

procedure TForm7. Button4Click(Sender: TObject);

begin

Edit1. Text: = ''; Edit2. Text: = ''; Edit3. Text: = ''; Edit4. Text: = '';

Edit5. Text: = ''; Edit6. Text: = ''; Edit7. Text: = ''; Edit8. Text: = '';

Edit9. Text: = ''; Edit10. Text: = ''; Edit11. Text: = ''; Edit12. Text: = '';

ADOQuery1. Active: = False;

end;

procedure TForm7. Button5Click(Sender: TObject);

begin

close;

end;

procedure TForm7. Edit1KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end;

procedure TForm7. Edit2KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end;

procedure TForm7. Edit3KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end;

procedure TForm7. Edit11KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end;

procedure TForm7. Button3Click(Sender: TObject);

begin

Form10. QuickRep1. Preview;

end;

procedure TForm7. Edit4KeyPress(Sender: TObject; var Key: Char);

begin

case Key of '0'. '9':; #8:

else Key: = #0;

end; end;

procedure TForm7. Edit5KeyPress(Sender: TObject; var Key: Char);

begin

case Key of '0'. '9':; #8:

else Key: = #0;

end; end;

procedure TForm7. Edit7KeyPress(Sender: TObject; var Key: Char);

begin

case Key of '0'. '9':; #8:

else Key: = #0;

end; end;

procedure TForm7. Edit8KeyPress(Sender: TObject; var Key: Char);

begin

case Key of '0'. '9':; #8:

else Key: = #0;

end; end;

procedure TForm7. Edit10KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:; #32:

else Key: = #0;

end; end; end.

unit Unit8;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, DB, ADODB, StdCtrls, ExtCtrls, DBCtrls, Grids, DBGrids;

type

TForm8 = class(TForm)

Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel;

Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel;

Label9: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel;

DBGrid1: TDBGrid; DBNavigator1: TDBNavigator; Edit1: TEdit;

Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; Edit5: TEdit; Edit6: TEdit;

Edit7: TEdit; Edit8: TEdit; Edit9: TEdit; Edit10: TEdit; Edit11: TEdit;

Edit12: TEdit; Panel1: TPanel; Button1: TButton; Button4: TButton;

ADOQuery1: TADOQuery; DataSource1: TDataSource; Button2: TButton;

Button3: TButton; procedure Button1Click(Sender: TObject);

procedure Button4Click(Sender: TObject);

procedure Button2Click(Sender: TObject);

procedure Button3Click(Sender: TObject);

procedure Edit1KeyPress(Sender: TObject; var Key: Char);

procedure Edit2KeyPress(Sender: TObject; var Key: Char);

procedure Edit3KeyPress(Sender: TObject; var Key: Char);

procedure Edit11KeyPress(Sender: TObject; var Key: Char);

procedure Edit4KeyPress(Sender: TObject; var Key: Char);

procedure Edit5KeyPress(Sender: TObject; var Key: Char);

procedure Edit7KeyPress(Sender: TObject; var Key: Char);

procedure Edit8KeyPress(Sender: TObject; var Key: Char);

procedure Edit10KeyPress(Sender: TObject; var Key: Char); private

{ Private declarations }

public

{ Public declarations }

end;

var

Form8: TForm8;

implementation

{$R *. dfm}

procedure TForm8. Button1Click(Sender: TObject);

begin

if (edit1. text='') and (edit2. text='') and (edit3. text='') and (edit4. text='') and (edit5. text='') and (edit6. text='') and (edit7. text='') and (edit8. text='') and (edit9. text='') and (edit10. text='') and (edit11. text='') and (edit12. text='') then Showmessage('Вы не внесли критерии поиска')

else

Begin

adoquery1. Parameters. ParamByName('p1'). Value: ='%'+edit1. text+'%';

adoquery1. Parameters. ParamByName('p2'). Value: ='%'+edit2. text+'%';

adoquery1. Parameters. ParamByName('p3'). Value: ='%'+edit3. text+'%';

adoquery1. Parameters. ParamByName('p4'). Value: ='%'+edit4. text+'%';

adoquery1. Parameters. ParamByName('p5'). Value: ='%'+edit5. text+'%';

adoquery1. Parameters. ParamByName('p6'). Value: ='%'+edit6. text+'%';

adoquery1. Parameters. ParamByName('p7'). Value: ='%'+edit7. text+'%';

adoquery1. Parameters. ParamByName('p8'). Value: ='%'+edit8. text+'%';

adoquery1. Parameters. ParamByName('p9'). Value: ='%'+edit9. text+'%';

adoquery1. Parameters. ParamByName('p10'). Value: ='%'+edit10. text+'%';

adoquery1. Parameters. ParamByName('p11'). Value: ='%'+edit11. text+'%';

adoquery1. Parameters. ParamByName('p12'). Value: ='%'+edit12. text+'%';

ADOQuery1. Active: = True;

end;

end;

procedure TForm8. Button4Click(Sender: TObject);

begin

Edit1. Text: = ''; Edit2. Text: = ''; Edit3. Text: = ''; Edit4. Text: = '';

Edit5. Text: = ''; Edit6. Text: = ''; Edit7. Text: = ''; Edit8. Text: = '';

Edit9. Text: = ''; Edit10. Text: = ''; Edit11. Text: = ''; Edit12. Text: = '';

ADOQuery1. Active: = false;

end;

procedure TForm8. Button2Click(Sender: TObject);

begin

ADOQuery1. Post; end

procedure TForm8. Button3Click(Sender: TObject);

begin close; end;

procedure TForm8. Edit1KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end;

procedure TForm8. Edit2KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end;

procedure TForm8. Edit3KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end;

procedure TForm8. Edit11KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end;

procedure TForm8. Edit4KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end;

procedure TForm8. Edit5KeyPress(Sender: TObject; var Key: Char);

begin

case Key of '0'. '9':; #8:

else Key: = #0;

end; end;

procedure TForm8. Edit7KeyPress(Sender: TObject; var Key: Char);

begin

case Key of '0'. '9':; #8:

else Key: = #0;

end; end;

procedure TForm8. Edit8KeyPress(Sender: TObject; var Key: Char);

begin

case Key of '0'. '9':; #8:

else Key: = #0;

end; end;

procedure TForm8. Edit10KeyPress(Sender: TObject; var Key: Char);

begin

case Key of 'а'. 'я':; 'А'. 'Я':; #8:

else Key: = #0;

end; end; end.

unit Unit9;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, ExtCtrls, QuickRpt, QRCtrls;

type

TForm9 = class(TForm)

QuickRep1: TQuickRep; QRBand1: TQRBand; QRLabel1: TQRLabel;

QRBand2: TQRBand; QRSubDetail1: TQRSubDetail; DetailBand1: TQRBand; QRLabel9: TQRLabel; QRLabel8: TQRLabel; QRLabel7: TQRLabel;

QRLabel6: TQRLabel; QRLabel51: TQRLabel; QRLabel50: TQRLabel;

QRLabel5: TQRLabel; QRLabel49: TQRLabel; QRLabel48: TQRLabel;

QRLabel47: TQRLabel; QRLabel46: TQRLabel; QRLabel45: TQRLabel;

QRLabel44: TQRLabel; QRLabel43: TQRLabel; QRLabel42: TQRLabel;

QRLabel41: TQRLabel; QRLabel40: TQRLabel; QRLabel4: TQRLabel; QRLabel39: TQRLabel; QRLabel38: TQRLabel; QRLabel37: TQRLabel;

QRLabel36: TQRLabel; QRLabel35: TQRLabel; QRLabel34: TQRLabel;

QRLabel33: TQRLabel; QRLabel32: TQRLabel; QRLabel31: TQRLabel;

QRLabel30: TQRLabel; QRLabel3: TQRLabel; QRLabel29: TQRLabel;

QRLabel28: TQRLabel; QRLabel27: TQRLabel; QRLabel26: TQRLabel;

QRLabel25: TQRLabel; QRLabel24: TQRLabel; QRLabel23: TQRLabel;

QRLabel22: TQRLabel; QRLabel21: TQRLabel; QRLabel20: TQRLabel; QRLabel2: TQRLabel; QRLabel19: TQRLabel; QRLabel18: TQRLabel;

QRLabel17: TQRLabel; QRLabel16: TQRLabel; QRLabel15: TQRLabel; QRLabel14: TQRLabel; QRLabel13: TQRLabel; QRLabel12: TQRLabel; QRLabel11: TQRLabel; QRLabel10: TQRLabel; QRDBText9: TQRDBText;

QRDBText8: TQRDBText; QRDBText7: TQRDBText; QRDBText6: TQRDBText; QRDBText50: TQRDBText; QRDBText5: TQRDBText; QRDBText49: TQRDBText; QRDBText48: TQRDBText; QRDBText47: TQRDBText; QRDBText46: TQRDBText; QRDBText45: TQRDBText;

QRDBText44: TQRDBText; QRDBText43: TQRDBText; QRDBText42: TQRDBText; QRDBText41: TQRDBText; QRDBText40: TQRDBText;

QRDBText4: TQRDBText; QRDBText39: TQRDBText; QRDBText38: TQRDBText; QRDBText37: TQRDBText; QRDBText36: TQRDBText;

QRDBText35: TQRDBText; QRDBText34: TQRDBText; QRDBText33: TQRDBText; QRDBText32: TQRDBText; QRDBText31: TQRDBText;

QRDBText30: TQRDBText; QRDBText3: TQRDBText; QRDBText29: TQRDBText; QRDBText28: TQRDBText; QRDBText27: TQRDBText;

QRDBText26: TQRDBText; QRDBText25: TQRDBText; QRDBText24: TQRDBText; QRDBText23: TQRDBText; QRDBText22: TQRDBText;

QRDBText21: TQRDBText; QRDBText20: TQRDBText;

QRDBText2: TQRDBText; QRDBText19: TQRDBText; QRDBText18: TQRDBText; QRDBText17: TQRDBText; QRDBText16: TQRDBText;

QRDBText15: TQRDBText; QRDBText14: TQRDBText; QRDBText13: TQRDBText; QRDBText12: TQRDBText; QRDBText11: TQRDBText; QRDBText10: TQRDBText; QRDBText1: TQRDBText;

procedure FormCreate(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form9: TForm9;

implementation

uses Unit1, Unit2, Unit3, Unit7;

{$R *. dfm}

end;

end.

unit Unit10;

interface

uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, QuickRpt, QRCtrls, ExtCtrls;

type

TForm10 = class(TForm)

QuickRep1: TQuickRep; QRBand1: TQRBand; QRLabel1: TQRLabel;

QRSubDetail1: TQRSubDetail; QRDBText1: TQRDBText; QRDBText2: TQRDBText; QRDBText3: TQRDBText; QRDBText4: TQRDBText;

QRDBText5: TQRDBText; QRBand2: TQRBand; QRLabel2: TQRLabel;

QRLabel3: TQRLabel; QRLabel4: TQRLabel; QRLabel5: TQRLabel;

QRLabel6: TQRLabel;

procedure FormCreate(Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form10: TForm10;

implementation

{$R *. dfm}

end.

Описание программы

Для работы с программой не требуется никаких специфических знаний компьютерных технологий, кроме навыков работы в среде операционной системы Windows 98 SE / ME / 2000/XP.

Помимо всего, для нормального функционирования программы необходима установка всех ее компонентов и модулей, а так же наличие необходимых программных средств (наличие исполняемого файла BazaDann. exe и файла базы данных Access Саша в одной папке). Запуск программы осуществляется двойным щелчком правой кнопки "мыши" по исполняемому файлу. После открытия главной форм "Картотека работников" пользователь выбирает в строке главного меню режим работы с программой. Программа должна, применяться при заданных условиях и в определенных целях.