FireBird数据库,一条SQL语句的错误
AnsiString sql_str="";
sql_str="SELECT DISTINCT ANSI_STR FROM TAG_LIST_TABLE WHERE FIELD_TAG=1";
tag_list_query->SQL->Clear();
tag_list_query->SQL->Add(sql_str);
tag_list_query->ExecSQL();
tag_list_query->Active=1;
if(tag_list_query->RecordCount==0) return;
//执行到此就报错,
//错误信息为:[0x0005]:Operation Not Supported.
这是什么原因?
[解决办法]
ExecSQL用于无结果集的sql语句.和firebird无关
sql_str="SELECT DISTINCT ANSI_STR FROM TAG_LIST_TABLE WHERE FIELD_TAG=1";tag_list_query->Active=false;//tag_list_query->SQL->Clear();tag_list_query->SQL->Add(sql_str);//tag_list_query->ExecSQL();tag_list_query->Active=true;if(tag_list_query->RecordCount==0) return;