Визуальный построитель запросов на извлечение
Курсовая работа, 23 Октября 2012, автор: пользователь скрыл имя
Краткое описание
Целью данной курсовой работы является разработка программы, способной на основе отношений строить запросы на извлечение информации посредством визуального построителя запросов.
На современном этапе развития информационных технологий, базы данных, а также умение пользователей получать нужную информацию приобретает всё большее значение.
Содержание
Введение………………………………………………………………………..…5
Постановка задачи………………………………………………………………..6
Реализация поставленной задачи…………………………………………….….8
Алгоритм построения запроса………………………………………….……….16
Тестирование и пример работы программы…………………………………...18
Заключение……………………………………………………………………….20
Список литературы………………………………………………………………21
Приложение……………………………………………………………………....22
Вложенные файлы: 1 файл
Визуальный построитель запросов.doc
— 268.00 Кб (Скачать файл)end;
procedure TForm2.Button2Click(Sender: TObject);
var i,k:integer;
f:boolean;
begin
//Измение в UseTAble
f:=true;
combobox1.Enabled:=true;
for i:=1 to strtoint(Unit1.UseTables[0].
if (useTables[i].name=combobox1.
for i:= 1 to strtoint(usetables[0].name)do
begin
if (i<>k)and(usetables[i].name=
if (i<>k)and(usetables[i].psevdo=
if ((edit1.Text='')and(usetables[
begin
showmessage('псевдоним не уникален');
f:=false;
end;
end;
if f then begin //если добалвен уникальный псевдоним
unit1.usetables[k].psevdo:=
form1.ListBox1.Items[k-1]:=
form2.Visible:=false;
for i:= 1 to 20 do
if edit1.Text=''
then unit1.combo[i,0].items[k-1]:=
else unit1.combo[i,0].items[k-1]:=
end;
button1.Enabled:=true;
end;
procedure TForm2.Button3Click(Sender: TObject);
var i, index:integer;
begin
//Удаление в UseTAble
if form1.FindTable(combobox1.
for i:= index to strtoint(UseTables[0].name)-1 do
begin
UseTables[i]:=UseTAbles[i+1]
end;
UseTables[0].name:=inttostr(
form1.ListBox1.Items.Delete(
form2.Visible:=false;
end;
end.
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,syscat;
type
TImageForm=record
IndexRadio:integer;
edit1,edit2,edit3,edit4:
combo1,combo2,combo3:string;
usl:string;
end;
TForm3 = class(TForm)
RadioButton1: TRadioButton;
Label2: TLabel;
RadioButton2: TRadioButton;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
RadioButton3: TRadioButton;
ComboBox1: TComboBox;
Button1: TButton;
ComboBox2: TComboBox;
ComboBox3: TComboBox;
Edit4: TEdit;
procedure initforms;
procedure setindex(i:integer);
procedure FormCreate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure ComboBox2Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
index:integer;
Form3: TForm3;
frm:array[1..20] of TImageForm;
implementation
uses Unit1;
{$R *.dfm}
procedure tform3.initforms;
var i:integer;
begin
for i:= 1 to 20 do
begin
frm[i].IndexRadio:=0;
frm[i].edit1:='';
frm[i].edit2:='';
frm[i].edit3:='';
frm[i].combo1:='';
frm[i].combo2:='';
end;
end;
procedure tform3.setindex(i:integer);
begin
index:=i;
end;
procedure TForm3.FormCreate(Sender: TObject);
begin
combobox1.items.Add('=');
combobox1.items.Add('>');
combobox1.items.Add('<');
combobox1.items.Add('<=');
combobox1.items.Add('>=');
combobox2.Items.Add('значение'
combobox2.Items.Add('поле');
initforms;
end;
procedure TForm3.Button1Click(Sender: TObject);
var f:boolean;
begin
f:=true;
frm[index].edit1:=edit1.Text;
frm[index].edit2:=edit2.Text;
frm[index].edit3:=edit3.Text;
frm[index].edit4:=edit4.Text;
frm[index].combo1:=combobox1.
frm[index].combo2:=combobox2.
frm[index].combo3:=combobox3.
if radiobutton1.Checked then begin
if GetTypeStr(unit1.Combo[index,
then begin
else f:=false;
end;
if radiobutton2.Checked then begin
frm[index].IndexRadio:=2;
if GetTypeStr(unit1.Combo[index,
end;
if radiobutton3.Checked then begin
frm[index].IndexRadio:=3;
if combobox2.Text='поле' then frm[index].usl:=unit1.combo[
end;
if f then begin
form3.Visible:=false;
form1.stringgrid2.cells[index,
end
else showmessage('Несоответствие типов');
end;
procedure TForm3.ComboBox2Change(Sender: TObject);
var i,j:integer;
begin
combobox3.Clear;
if combobox2.Text='поле' then begin
edit4.Visible:=false;
combobox3.Visible:=true;
for i:=1 to strtoint(unit1.usetables[0].
for j:=1 to strtoint(unit1.usetables[i].
end
else begin
edit4.Visible:=true;
combobox3.Visible:=false;
end;
end;
end.