Курсовая работа: Реляційна база данних трудової книжки
Query21->SQL->Add(
"select content from variables where variables.var='subkobid'"
);
Query21->Open();
int skobid = Query21->Fields->FieldByName("content")->AsInteger;
Query21->Close();
Query21->SQL->Clear();
Query21->SQL->Add(
"select count(z_algo.id) as cnt from z_algo,variables where z_algo.skobid=variables.content and variables.var='subkobid'"
);
Query21->Open();
if(!(Query21->Fields->FieldByName("cnt")->AsInteger>0)){
Query21->Close();
Query21->SQL->Clear();
Query21->SQL->Add(
x+"insert into z_algo values( 0,"+skobid+",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'',0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) "
);
Query21->ExecSQL();
}
//Table1->Close();
Table1->Filtered=false;
Table1->Filter=x+"skobid = "+skobid;
Table1->Filtered=true;
Table1->Open();
Table2->Close();
Table2->Open();
// vchiteli
CheckBox1->Checked = Table1->Fields->FieldByName("isvchitel")->AsInteger ? true:false;
CheckBox3->Checked = Table1->Fields->FieldByName("iskategoriya")->AsInteger ? true:false;