Статьи Королевства Дельфи


L3_pas - часть 2


end

else { Структура не нужна - удалить из памяти }

FDbInterface.Kill_NpTFieldInfo;

finally

FreeAndNil(FldDlgFr);

end;

end;

// Завершение создания таблицы в БД

Function TTbDefFr.Execute: Bool;

Var

wTb : TTable;

begin

Result := False;

if not FModalRes then

Exit;

wTb := TTable.Create(nil);

wTb.DatabaseName := FDbInterface.DatabaseName;

try

wTb.TableName := 'T_Tables';

if not wTb.Exists then

Create_T_Tables(wTb);

wTb.TableName := 'T_Fields';

if not wTb.Exists then

Create_T_Fields(wTb);

finally

wTb.Free;

end;

FpTTableInfo.spTInfoCategory := FpTInfoCategory;

Result := FDbInterface.CreateFbTableBySQL(FpTTableInfo,

TbFieldsListBox.Items);

end;

procedure TTbDefFr.CancelButtonClick(Sender: TObject);

begin

FModalRes := False;

Close;

end;

procedure TTbDefFr.OkButtonClick(Sender: TObject);

begin

FModalRes := True;

Close;

end;

procedure TTbDefFr.FormCreate(Sender: TObject);

begin

Label4.Caption := '';

Label5.Caption := '';

Label7.Caption := '';

Label8.Caption := '';

TbNameLbl.Caption := '';

end;

// Вывод сведений о поле для наблюдения

procedure TTbDefFr.TbFieldsListBoxClick(Sender: TObject);

Var

k : Integer;

wpFldInfo : pTFieldInfo;

wTFieldType : TFieldType;

begin

Label4.Visible := False;

Label5.Visible := False;

Label7.Visible := False;

Label8.Visible := False;

if TbFieldsListBox.Items.Count = 0 then

Exit;

k := TbFieldsListBox.ItemIndex;

if TbFieldsListBox.Items.Objects[k] = nil then

Exit;

wpFldInfo := pTFieldInfo(TbFieldsListBox.Items.Objects[k]);

wTFieldType := wpFldInfo.sFieldType;

Label4.Caption := FDbInterface.FbFieldArray[wTFieldType].sDescr;

Label5.Caption := IntToStr(wpFldInfo.sFieldSize) +

'/' + IntToStr(wpFldInfo.sFieldMBytes);

Label7.Caption := wpFldInfo.sFieldAttr.Values['sFieldCaption'];

Label8.Caption := wpFldInfo.sFieldAttr.Values['sFieldDescr'];

Label4.Visible := Label4.Caption <> '';

Label5.Visible := Label5.Caption <> '';

Label7.Visible := Label7.Caption <> '';

Label8.Visible := Label8.Caption <> '';




Начало  Назад  Вперед



Книжный магазин