int tmp_pageseq,tmp_iopseq,tmp_bal;
Form1->Query1->Close();
Form1->Query1->SQL->Clear();
Form1->Query1->SQL->Add("select from subject where ");
Form1->Query1->SQL->Add(" subcode="+Edit1->Text+" and ");
Form1->Query1->SQL->Add(" subvest = "+Edit2->Text+"");
Form1->Query1->Open();
tmp_pageseq = Form1->Query1->FieldByName("pageseq");
tmp_iopseq = Form1->Query1->FieldByName("iopseq");
tmp_bal = Form1->Query1->FieldByName("bal");
其中iopseq,pageseq,bal是后台数据表的字段,编译时说我iopseq,pageseq,bal
没有定义
谢谢
//加一个AsInteger不然FiledByName()返回的是字段类型不是数值类型
{
int tmp_pageseq,tmp_iopseq,tmp_bal;
Form1->Query1->Close();
Form1->Query1->SQL->Clear();
Form1->Query1->SQL->Add("select from subject where ");
Form1->Query1->SQL->Add(" subcode="+Edit1->Text+" and ");
Form1->Query1->SQL->Add(" subvest = "+Edit2->Text+"");
Form1->Query1->Open();
tmp_pageseq = Form1->Query1->FieldByName("pageseq")->AsInteger;
tmp_iopseq = Form1->Query1->FieldByName("iopseq")->AsInteger;
tmp_bal = Form1->Query1->FieldByName("bal")->AsInteger;
}
来晚了,同上!