| Код | if (Q_T->Active) Q_T->Close(); Q_T->SQL->Clear(); Q_T->SQL->Add("Select *, (select NP from Phones where N=Op.id_P) as name, (select Phone from Phones where N=Op.id_P) as Phone, (select Dol from Phones where N=Op.id_P) as Dol, (select Name from Cont where N=(select IdF from Phones where N=Op.id_P)) as firm from Op"); if ((ing!="") || (fir!="") || (con!="")) { Q_T->SQL->Add("where "); if (ing!="") { Q_T->SQL->Add("(ing=:ing)"); Q_T->Parameters->ParamByName("ing")->Value=ing; f=1; } if (fir!="") { // если заполнена переменная пишет " отсутствует значение одного или нескольких параметров" if (f==1) Q_T->SQL->Add(" and "); Q_T->SQL->Add("(firm=:fir)"); Q_T->Parameters->ParamByName("fir")->Value=fir; } } Q_T->SQL->Add(";"); Q_T->Open();
|
Подскажите что не так делаю... |