我有这个查询
SELECT COUNT (*) FROM Carti WHERE TITLU='" + this->Titlu +"'
我需要将结果放入一个变量中,并且我需要它是整数。这是代码:
AnsiString ttl="SELECT COUNT(TITLU) as NR FROM Carti WHERE TITLU='" + this->TitluC +"'";
CarteQuery -> Close();
CarteQuery -> SQL -> Clear();
CarteQuery -> SQL -> Add(ttl);
CarteQuery -> Transaction -> StartTransaction();
CarteQuery -> Open;
CarteQuery -> FieldByName("NR")->AsInteger;
但是我的程序在这一行迷恋
CarteQuery -> FieldByName("NR")->AsInteger;