Курсовая работа: Информационная система военного округа
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button8Click(TObject *Sender)
{
ADOQuery1->Active=false;
ADOQuery1->SQL->Clear();
ADOQuery1->SQL->Add("Create trigger trig on Obedinenie for update as begin if update([nazvanie_armii]) begin UPDATE chast SET chast.nazvanie_armii=inserted.nazvanie_armii FROM chast, deleted, inserted WHERE chast.nazvanie_armii=deleted.nazvanie_armii end end");
ADOQuery1->ExecSQL();
ADOTable1->Active=false;
Form2->DBEdit1->DataField="";
Form2->DBEdit2->DataField="";
Form2->DBEdit3->DataField="";
Form2->DBEdit4->DataField="";
Form2->DBEdit5->DataField="";
Form2->DBEdit6->DataField="";
Form2->DBEdit7->DataField="";
DBText1->DataField="";
DBText1->DataSource=DataSource1;
DBText1->DataField="nazvanie_armii";
ADOTable1->TableName="Obedinenie";
Label4->Caption=ADOTable1->TableName;
ADOTable1->Active=true;
ADOTable2->Active=false;
ADOTable2->TableName="Chast" ;
Label5->Caption=ADOTable2->TableName;
ADOTable2->Active=true;
DBText1->DataField="nazvanie_armii";
}
//---------------------------------------------------------------------------