. , , ,

,,,

"-" — ,

 

 

 

 

 

 

" "

: " "-"

:

() ()

() ()

()

_____________________

() ()

2009


1.

2.

2.1

2.2

2.3

3.

3.1

3.2


, . , , .

"-" , .

MSSQL Server 2000. , , . Borland Delphi. , MSSQL Server 2000, .

SQL (Structured Query Language) . .

SQL , , ( 30) . SQL ( ) ( ). :

( , );

;

( .);

(, , ).

, :

, ;

, ;

;

( );

: , , , , , .

, MSSQL Server :

Enterprise Manager;

Service Manager;

Query Analyzer.

SQL Server - , , - :

;

;

;

.


1.

" - ", 9 :

( , , , , , , , , );

( , , , /, , , , , , , );

( , , , , );

( , );

( , );

( , );

( , );

( , );

( , , ).

:

.

.

.

, .

, : , , .

.

"" , .

, .

, .

.

.


2.

 

2.1

"_". , , , , , . - , , . , : , , , ; .

:

;

,

,

,

,

,

,

,

,

.

"_" . . - , :

/

- :

:

, .

, .

, , .

 
 


2.2

, , ("", "", "", " ", ", "", " ", " " ""). . " " "" "" "".

" " "" "".

" " " " "" "".

" " "" "".

" " " " "". " " " " "". " " " " "". " " "" "". .2.2.1

.2.2.1 -


2.3

- , , , , .

1NF , . 1-

:

( , , /, , , , , , . , , )

: ,

-

-

-

-

-

- .

-

-

. -

-

, , , , / . - , , , . : - _ -_.

-_ ( , , , , , )

,

:

, -

, -

, -

, -

-_ ( , , , , , , , , . , , )

, -

, -

, -

, -

, -

, -

, - .

, -

, -

. -

2 NF

-_. - ; - . . - . , .

-_ -_-. :

-_-. ( , , , , , , , , . , )

:

:

, -

, -

, -

, -

, -

, -

, - .

, -

( , )

:

.

:

. -

3NF.

-

-_-. ( , , , , , , , , . , )

, .

: -_-

-_- ( , )

:

:

-

-_- ( , , , , , , , . , )

: ,

:

, -

, -

, -

, -

, -

, - .

, -

, , (→), , (→). .

:

→→

→→

:

-_- ( , , , , , , . ,

: ,

:

, -

, -

, -

, -

, - .

, -

-_- ( , , , , , , . , )

: ,

:

, -

, -

, -

, -

, - .

, -

4NF

5NF, , .

6

-__ ( , , )

,

:

, -

-__ ( , , )

,

:

, -

-__ ( , , , )

,

:

, -

-__ ( , , )

,

:

, -

-_- ( , )

:

:

-

-__ ( , , )

: ,

, -

-_- ( , , , )

: ,

:

, -

-_- ( , , )

: ,

:

, -

-_- ( , , )

: ,

:

, -

-_- ( , , )

: ,

:

, -

-_-. ( , , . )

: ,

:

, - .

-_- ( , , )

: ,

:

, -


3.

"-" Borland Delphi MSSQL Server 2000. 4 6 .

 

3.1

:

1. Unit1, Unit1. pas .

2. Unit2, Unit2. pas TZaprosy ().

3. Unit3 Unit3. pas, TOtchety ().

4. Unit4 Unit4. pas, TProcedury ().

5. Unit5, Unit5. pas TSpravka ().

6. Unit6 Unit6. pas .

 

3.2

 

1. , .

SELECT [ ], COUNT ([])

FROM

GROUP BY [ ]

ORDER BY [ ] ;

2. <>

SELECT [], []

FROM

WHERE [] LIKE '%111%';

3. "" , .

SELECT . [], ' =', datediff (yy, . [ ],getdate ())

FROM , ,

WHERE . [] =. []

and . [ ] =. [ ]

and . [] like '%%'

and [ ] < getdate ();

4. <i-> .

SELECT . [], _. [ ], . [ ]

FROM , _,

WHERE _. [ ] =. [ ]

AND . [ ] =. [ ]

AND _. [ ] ='-'

AND month ([ ]) =month (getdate ());

5. , .

SELECT . [], _. [ ]

FROM _, , , ,

WHERE _. [ ] =. [ ]

AND . [ ] =. [ ]

AND . [] =. []

AND . [ ] = ' '

AND year (. [ ]) =year (getdate ());

1.

SELECT . [],

. [ ],

. [ ],

_. [ ],

. [ ]

FROM , , _

WHERE _. [ ] = . [ ]

AND . [ ] = . [ ] ;

2. "I-"

SELECT . [ ],

. [],

. [ ],

_. [ ],

. [ ]

FROM , _,

WHERE _. [ ] = . [ ]

AND . [ ] = . [ ]

AND year (. [ ]) =year ('13 October 2007')

and month (. [ ]) =month ('13 October 2007')

and day (. [ ]) =day ('13 October 2007');

3. ,

SELECT . [],

_. [ ]

FROM _, , , ,

WHERE _. [ ] =. [ ]

AND . [ ] =. [ ]

AND . [] =. []

AND . [ ] = ' '

AND year (. [ ]) =year (getdate ());

1. , 10 .

USE _

GO

CREATE PROCEDURE Vyboravto1

AS

SELECT *

FROM

WHERE year ([ ]) > year ('01 January 1997')

GO

execute Vyboravto1

go

2. .

USE _

GO

CREATE PROCEDURE Vyboravto2 @marka_id int, @kuzov_id int

AS

SELECT *

FROM

WHERE [ ] = @marka_id

and [ ] = @kuzov_id

GO

USE _

GO

EXECUTE Vyboravto2 2, 2

GO


.

. .

, .

.


unit Unit1;

interface

uses

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

Dialogs, Menus, DB, ADODB, ExtCtrls, DBCtrls, Grids, DBGrids, ComCtrls;

type

TForm1 = class (TForm)

MainMenu1: TMainMenu;

N1: TMenuItem;

N2: TMenuItem;

N3: TMenuItem;

N4: TMenuItem;

N5: TMenuItem;

N6: TMenuItem;

N7: TMenuItem;

N8: TMenuItem;

N9: TMenuItem;

N10: TMenuItem;

N11: TMenuItem;

N12: TMenuItem;

N13: TMenuItem;

N14: TMenuItem;

N15: TMenuItem;

N16: TMenuItem;

ADOTable1: TADOTable;

DataSource1: TDataSource;

DBGrid1: TDBGrid;

DBNavigator1: TDBNavigator;

StatusBar1: TStatusBar;

N17: TMenuItem;

procedure N15Click (Sender: TObject);

procedure N3Click (Sender: TObject);

procedure N4Click (Sender: TObject);

procedure N5Click (Sender: TObject);

procedure N16Click (Sender: TObject);

procedure N6Click (Sender: TObject);

procedure N7Click (Sender: TObject);

procedure N8Click (Sender: TObject);

procedure N9Click (Sender: TObject);

procedure N10Click (Sender: TObject);

procedure N11Click (Sender: TObject);

procedure N12Click (Sender: TObject);

procedure N13Click (Sender: TObject);

procedure N14Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form1: TForm1;

implementation

uses Unit2, Unit3, Unit4, Unit5;

{$R *. dfm}

procedure TForm1. N15Click (Sender: TObject);

begin

Spravka. Show; // close;

end;

procedure TForm1. N3Click (Sender: TObject);

begin

Zaprosy. Show;

end;

procedure TForm1. N4Click (Sender: TObject);

begin

Otchety. Show;

end;

procedure TForm1. N5Click (Sender: TObject);

begin

Procedury. Show;

end;

procedure TForm1. N16Click (Sender: TObject);

begin

close;

end;

procedure TForm1. N6Click (Sender: TObject);

begin

ADOTable1. Active: =false;

ADOTable1. TableName: ='_';

ADOTable1. Active: =true;

StatusBar1. SimpleText: =n6. Caption;

end;

procedure TForm1. N7Click (Sender: TObject);

begin

ADOTable1. Active: =false;

ADOTable1. TableName: ='';

ADOTable1. Active: =true;

StatusBar1. SimpleText: =n7. Caption;

end;

procedure TForm1. N8Click (Sender: TObject);

begin

ADOTable1. Active: =false;

ADOTable1. TableName: ='_';

ADOTable1. Active: =true;

StatusBar1. SimpleText: =n8. Caption;

end;

procedure TForm1. N9Click (Sender: TObject);

begin

ADOTable1. Active: =false;

ADOTable1. TableName: ='_';

ADOTable1. Active: =true;

StatusBar1. SimpleText: =n9. Caption;

end;

procedure TForm1. N10Click (Sender: TObject);

begin

ADOTable1. Active: =false;

ADOTable1. TableName: ='_';

ADOTable1. Active: =true;

StatusBar1. SimpleText: =n10. Caption;

end;

procedure TForm1. N11Click (Sender: TObject);

begin

ADOTable1. Active: =false;

ADOTable1. TableName: ='';

ADOTable1. Active: =true;

StatusBar1. SimpleText: =n11. Caption;

end;

procedure TForm1. N12Click (Sender: TObject);

begin

ADOTable1. Active: =false;

ADOTable1. TableName: ='';

ADOTable1. Active: =true;

StatusBar1. SimpleText: =n12. Caption;

end;

procedure TForm1. N13Click (Sender: TObject);

begin

ADOTable1. Active: =false;

ADOTable1. TableName: ='';

ADOTable1. Active: =true;

StatusBar1. SimpleText: =n13. Caption;

end;

procedure TForm1. N14Click (Sender: TObject);

begin

ADOTable1. Active: =false;

ADOTable1. TableName: ='';

ADOTable1. Active: =true;

StatusBar1. SimpleText: =n14. Caption;

end;

end.

unit Unit2;

interface

uses

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

Dialogs, StdCtrls, Grids, DBGrids, DB, ADODB, Mask, Buttons;

type

TZaprosy = class (TForm)

ADODataSet1: TADODataSet;

DataSource1: TDataSource;

DBGrid1: TDBGrid;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

Label4: TLabel;

Label5: TLabel;

MaskEdit1: TMaskEdit;

ComboBox1: TComboBox;

Label6: TLabel;

SpeedButton1: TSpeedButton;

SpeedButton2: TSpeedButton;

SpeedButton3: TSpeedButton;

SpeedButton4: TSpeedButton;

SpeedButton5: TSpeedButton;

Label7: TLabel;

Label8: TLabel;

Label9: TLabel;

Label10: TLabel;

Label11: TLabel;

procedure SpeedButton1Click (Sender: TObject);

procedure SpeedButton2Click (Sender: TObject);

procedure SpeedButton3Click (Sender: TObject);

procedure SpeedButton4Click (Sender: TObject);

procedure SpeedButton5Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Zaprosy: TZaprosy;

implementation

{$R *. dfm}

procedure TZaprosy. SpeedButton1Click (Sender: TObject);

begin

adodataset1. Active: =false;

adodataset1.commandText: =' SELECT . [ ], COUNT (. []) '+

' FROM '+

// ' WHERE . [ ] = . [ ] ';

' GROUP BY . [ ] ' +

' ORDER BY . [ ] ; ';

adodataset1. Active: =true;

end;

procedure TZaprosy. SpeedButton2Click (Sender: TObject);

begin

adodataset1. Active: =false;

adodataset1.commandText: =' SELECT [], [] '+

' FROM '+

' WHERE [] LIKE '+''''+'%'+MaskEdit1. Text+'%'+'''';

adodataset1. Active: =true;

end;

procedure TZaprosy. SpeedButton3Click (Sender: TObject);

begin

adodataset1. Active: =false;

adodataset1.commandText: =' SELECT . [], datediff (yy, . [ ],getdate ()) '+

' FROM , , '+

' WHERE . [] =. [] '+

' and . [ ] =. [ ] '+

' and . [ ] like ''%%'''+

' and [ ] < getdate (); ';

adodataset1. Active: =true;

end;

procedure TZaprosy. SpeedButton4Click (Sender: TObject);

begin

adodataset1. Active: =false;

adodataset1.commandText: =' SELECT . [], _. [ ], . [ ] '+

' FROM , _, '+

' WHERE _. [ ] =. [ ] '+

' AND . [ ] =. [ ] '+

' AND _. [ ] like '+''''+'%'+combobox1. Text+'%'+'''' +

' AND month ([ ]) =month (getdate ()); ';

adodataset1. Active: =true;

end;

procedure TZaprosy. SpeedButton5Click (Sender: TObject);

begin

adodataset1. Active: =false;

adodataset1.commandText: =' SELECT . [], _. [ ] '+

' FROM _, , , , '+

' WHERE _. [ ] =. [ ] '+

' AND . [ ] =. [ ] '+

' AND . [] =. [] '+

' AND . [ ] = '' '''+

' AND year (. [ ]) =year (getdate ()); ';

adodataset1. Active: =true;

end;

end.

unit Unit3;

interface

uses

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

Dialogs, StdCtrls, Buttons, Grids, DBGrids, DB, ADODB, Mask, Menus,

Word2000, OleServer;

type

TOtchety = class (TForm)

MainMenu1: TMainMenu;

N1: TMenuItem;

Label1: TLabel;

Label2: TLabel;

Label3: TLabel;

ADODataSet2: TADODataSet;

DBGrid1: TDBGrid;

DataSource1: TDataSource;

Label4: TLabel;

ComboBox1: TComboBox;

SpeedButton1: TSpeedButton;

SpeedButton2: TSpeedButton;

SpeedButton3: TSpeedButton;

Label5: TLabel;

Label6: TLabel;

ComboBox2: TComboBox;

Label7: TLabel;

N2: TMenuItem;

WordDocument1: TWordDocument;

WordApplication1: TWordApplication;

SaveDialog1: TSaveDialog;

procedure N1Click (Sender: TObject);

procedure SpeedButton1Click (Sender: TObject);

procedure SpeedButton2Click (Sender: TObject);

procedure SpeedButton3Click (Sender: TObject);

procedure N2Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Otchety: TOtchety;

otchetnum: integer;

implementation

uses Unit6;

{$R *. dfm}

procedure TOtchety. N1Click (Sender: TObject);

var

c,n: integer;

s,rs: string;

begin

form6. Show;

// leep (10);

for n: =0 to adodataset2. RecordCount-1 do

begin

rs: ='';

s: ='';

if n=0 then

begin

for c: =0 to DBGrid1. Columns. Count-1 do

begin

s: =DBGrid1. Columns [c]. FieldName+ '';

rs: =rs+s;

end;

form6. Memo1. Lines. Add (rs);

rs: ='';

s: ='';

end;

for c: =0 to DBGrid1. Columns. Count-1 do

begin

s: =DBGrid1. Columns [c]. Field. AsString+'';

rs: =rs+s;

end;

form6. memo1. Lines. Add (rs);

adodataset2. Next;

end;

begin

if form6. savedialog1. Execute then

form6. memo1. Lines. SaveToFile (form6. savedialog1. FileName);

end;

end;

procedure TOtchety. SpeedButton1Click (Sender: TObject);

begin

adodataset2. Active: =false;

adodataset2.commandText: =' SELECT . [], . [ ],'+

'. [ ], _. [ ],'+

'. [ ] '+

' FROM , ,_ '+

' WHERE . [] like '+''''+'%'+combobox1. Text+'%'+'''' +

' AND _. [ ] = . [ ] '+

' AND . [ ] = . [ ] ; ';

adodataset2. Active: =true;

end;

procedure TOtchety. SpeedButton2Click (Sender: TObject);

begin

adodataset2. Active: =false;

adodataset2.commandText: =' SELECT [], . [ ], . [/] '+

' FROM , '+

' WHERE . [ ] = . [ ] '+

' AND [ ] = '''' '+

' order by . [/] ';

adodataset2. Active: =true;

end;

procedure TOtchety. SpeedButton3Click (Sender: TObject);

begin

// QuotedStr (Maskedit2. Text);

adodataset2. Active: =false;

adodataset2.commandText: =' SELECT . [ ], . [], . [ ],'+

'_. [ ], . [ ] '+

' FROM , _, '+

' WHERE _. [ ] = . [ ] '+

' AND . [ ] = . [ ] '+

' and . [ ] ='''+ComboBox2. Text +'''';

// ' AND year (. [ ]) =year (''13 October 2007'') '+

// ' and month (. [ ]) =month (''13 October 2007'') '+

// ' and day (. [ ]) =day (''13 October 2007''); ';

// ' and SHTRAFI. Oplacheno = '' '' AND dbo. SHTRAFI. Data BETWEEN '''+ MaskEdit3. Text +''' AND '''+ MaskEdit4. Text +''' '+

// ' AND Aaeea? aoee. "aaoa iiaa? e"='''+ComboBox2. Text +''''+

adodataset2. Active: =true;

end;

procedure TOtchety. N2Click (Sender: TObject);

var filename,ran1: Olevariant;

rowcount,colcount, i,j: integer;

temp: string;

begin

savedialog1. FileName: ='otchet'+inttostr (otchetnum) +'. doc'; //

otchetnum: =otchetnum+1; //

wordapplication1. Connect; //

filename: =savedialog1. FileName;

wordapplication1. Documents. Add (emptyparam,emptyparam,emptyparam,emptyparam); //

worddocument1. connectto (wordapplication1. activedocument); //

// ran1: =worddocument1. Range;

rowcount: =adodataset2. RecordCount; //

colcount: =dbgrid1. Columns. Count; //

worddocument1. Tables. Add (worddocument1. Range,rowcount,colcount,emptyparam,emptyparam); // -

for i: =1 to rowcount do

begin

for j: =1 to colcount do

begin

temp: =dbgrid1. Fields [j-1]. AsString; //

worddocument1. Tables. Item (1). cell (i,j). range. text: =temp; // doc

end;

adodataset2. Next; //

end;

WordApplication1. Visible: = True; //

worddocument1. SaveAs (filename); //

end;

end.

procedure TForm3. BitBtn1Click (Sender: TObject);

begin

QuotedStr (maskedit1. Text);

QuotedStr (maskedit2. Text);

adodataset2. Active: =false;

adodataset2.commandText: =' SELECT dbo. UDOSTOVERENIYA. N_udostovereniya, dbo. UDOSTOVERENIYA. Data_vipiski, dbo. UDOSTOVERENIYA. Srok_deistviya, dbo. INSPEKTOR. FIO '+

' FROM dbo. UDOSTOVERENIYA INNER JOIN '+

' dbo. INSPEKTOR ON dbo. UDOSTOVERENIYA. Kod_inspectora = dbo. INSPEKTOR. Kod_inspektora '+

' WHERE (dbo. INSPEKTOR. FIO LIKE '+'''%'+Edit3. Text+'%'+''' AND dbo. UDOSTOVERENIYA. Data_vipiski BETWEEN '''+ MaskEdit1. Text + ''' AND '''+ MaskEdit2. Text +''') ';

adodataset2. Active: =true;

end.

unit Unit4;

interface

uses

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

Dialogs, StdCtrls, Grids, DBGrids, DB, ADODB, Buttons;

type

TProcedury = class (TForm)

ADODataSet1: TADODataSet;

DataSource1: TDataSource;

DBGrid1: TDBGrid;

Label1: TLabel;

Label2: TLabel;

Label5: TLabel;

Label6: TLabel;

Label7: TLabel;

ComboBox1: TComboBox;

Label8: TLabel;

ComboBox2: TComboBox;

ComboBox3: TComboBox;

ComboBox4: TComboBox;

SpeedButton1: TSpeedButton;

SpeedButton2: TSpeedButton;

Label10: TLabel;

Label11: TLabel;

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

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

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

procedure ComboBox3Change (Sender: TObject);

procedure ComboBox4Change (Sender: TObject);

procedure SpeedButton1Click (Sender: TObject);

procedure SpeedButton2Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Procedury: TProcedury;

implementation

{$R *. dfm}

procedure TProcedury.comboBox1KeyPress (Sender: TObject; var Key: Char);

begin

if not (key in ['0'. '9',#8]) then key: =#0;

end;

procedure TProcedury.comboBox3KeyPress (Sender: TObject; var Key: Char);

begin

if not (key in ['0'. '9',#8]) then key: =#0;

end;

procedure TProcedury.comboBox2KeyPress (Sender: TObject; var Key: Char);

begin

if not (key in ['0'. '9',#8]) then key: =#0;

end;

procedure TProcedury.comboBox3Change (Sender: TObject);

var

i: integer;

begin

for i: =0 to ComboBox3. Items. Count do

if ComboBox3. ItemIndex=i then ComboBox1. ItemIndex: =i;

end;

procedure TProcedury.comboBox4Change (Sender: TObject);

var

i: integer;

begin

for i: =0 to ComboBox4. Items. Count do

if ComboBox4. ItemIndex=i then ComboBox2. ItemIndex: =i;

end;

procedure TProcedury. SpeedButton1Click (Sender: TObject);

begin

adodataset1. Active: =false;

adodataset1.commandText: ='execute Vyboravto1';

adodataset1. Active: =true;

end;

procedure TProcedury. SpeedButton2Click (Sender: TObject);

begin

adodataset1. Active: =false;

adodataset1.commandText: ='execute Vyboravto2 '''+ combobox1. Text + ''',''' + combobox2. Text +''' ';

adodataset1. Active: =true;

end;

end.

unit Unit5;

interface

uses

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

Dialogs, DB, ADODB, Grids, DBGrids, StdCtrls, Buttons;

type

TSpravka = class (TForm)

DataSource1: TDataSource;

DBGrid1: TDBGrid;

ADODataSet1: TADODataSet;

Label5: TLabel;

Label8: TLabel;

Label3: TLabel;

ComboBox4: TComboBox;

Label11: TLabel;

Label12: TLabel;

ComboBox5: TComboBox;

Label14: TLabel;

Label15: TLabel;

ComboBox6: TComboBox;

BitBtn1: TBitBtn;

procedure BitBtn1Click (Sender: TObject);

{ Private declarations }

public

{ Public declarations }

end;

var

Spravka: TSpravka;

sum1, sum2, sum3: boolean;

implementation

{$R *. dfm}

procedure TSpravka. BitBtn1Click (Sender: TObject);

begin

sum1: =false;

sum2: =false;

sum3: =false;

if ComboBox4. Text<>'' then sum1: =true;

if ComboBox5. Text<>'' then sum2: =true;

if ComboBox6. Text<>'' then sum3: =true;

if (sum1) and (sum2) and (sum3) then

begin

adodataset1. Active: =false;

adodataset1.commandText: ='SELECT. * ' +

' FROM, _, , _' +

' WHERE . [ ] =_. [ ] ' +

' AND . [ ] =_. [ ] ' +

' AND . [ ] =. [ ] '+

' AND _. [] ='''+ComboBox4. Text +''''+

' AND _. [] ='''+ComboBox5. Text +''''+

' AND . [] ='''+ComboBox6. Text +'''';

adodataset1. Active: =true;

end;

if (not sum1) and (not sum2) and (not sum3) then

begin

adodataset1. Active: =false;

adodataset1.commandText: ='SELECT* '+

' FROM';

adodataset1. Active: =true;

end;

if (not sum1) and (not sum2) and (sum3) then

begin

adodataset1. Active: =false;

adodataset1.commandText: ='SELECT. * ' +

' FROM, ' +

' WHERE . [ ] =. [ ] '+

' AND . [] ='''+ComboBox6. Text +'''';

adodataset1. Active: =true;

end;

if (not sum1) and (sum2) and (not sum3) then

begin

adodataset1. Active: =false;

adodataset1.commandText: ='SELECT. * ' +

' FROM, _' +

' WHERE . [ ] =_. [ ] ' +

' AND _. [] ='''+ComboBox5. Text +'''';

adodataset1. Active: =true;

end;

if (sum1) and (not sum2) and (not sum3) then

begin

adodataset1. Active: =false;

adodataset1.commandText: ='SELECT. * ' +

' FROM, _' +

' WHERE . [ ] =_. [ ] ' +

' AND _. [] ='''+ComboBox4. Text +'''';

adodataset1. Active: =true;

end;

if (not sum1) and (sum2) and (sum3) then

begin

adodataset1. Active: =false;

adodataset1.commandText: ='SELECT. * ' +

' FROM, _, ' +

' WHERE . [ ] =_. [ ] ' +

' AND . [ ] =. [ ] '+

' AND _. [] ='''+ComboBox5. Text +''''+

' AND . [] ='''+ComboBox6. Text +'''';

adodataset1. Active: =true;

end;

if (sum1) and (not sum2) and (sum3) then

begin

adodataset1. Active: =false;

adodataset1.commandText: ='SELECT. * ' +

' FROM, _, , _' +

' WHERE . [ ] =_. [ ] ' +

' AND . [ ] =. [ ] '+

' AND _. [] ='''+ComboBox4. Text +''''+

' AND . [] ='''+ComboBox6. Text +'''';

adodataset1. Active: =true;

end;

if (sum1) and (sum2) and (not sum3) then

begin

adodataset1. Active: =false;

adodataset1.commandText: ='SELECT. * ' +

' FROM, _, _' +

' WHERE . [ ] =_. [ ] ' +

' AND . [ ] =_. [ ] ' +

' AND _. [] ='''+ComboBox4. Text +''''+

' AND _. [] ='''+ComboBox5. Text +'''';

adodataset1. Active: =true;

end;

end;

end.

unit Unit6;

interface

uses

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

Dialogs, StdCtrls;

type

TForm6 = class (TForm)

Memo1: TMemo;

SaveDialog1: TSaveDialog;

Button1: TButton;

procedure Button1Click (Sender: TObject);

private

{ Private declarations }

public

{ Public declarations }

end;

var

Form6: TForm6;

implementation

{$R *. dfm}

procedure TForm6. Button1Click (Sender: TObject);

begin

memo1. Lines. Text: ='';

form6. Hide;

end; end.

&quot;

 

 

 

! , , , .
. , :