50136 (Создание базы данных "РЭО-ГАИ"), страница 4
Описание файла
Документ из архива "Создание базы данных "РЭО-ГАИ"", который расположен в категории "". Всё это находится в предмете "информатика" из 1 семестр, которые можно найти в файловом архиве . Не смотря на прямую связь этого архива с , его также можно найти и в других разделах. Архив можно найти в разделе "курсовые/домашние работы", в предмете "информатика, программирование" в общих файлах.
Онлайн просмотр документа "50136"
Текст 4 страницы из документа "50136"
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.