写了如下的一段程序:with datamodule1.qry_rstemp do
begin
close;
sql.clear;
sql.add('select * from xsmc where xsxh_id not in (select xsxh_id from byqk) and zyh0=:id');
parambyname('id').asstring:=dbgrid1.Fields[0].asstring;
open; //运行到这里 报错
end;
错误提示为:EDBEngineError with message:capability not supported
什么意思啊??? 什么能力不支持请高手们指导
begin
close;
sql.clear;
sql.add('select * from xsmc where xsxh_id not in (select xsxh_id from byqk) and zyh0=:id');
parambyname('id').asstring:=dbgrid1.Fields[0].asstring;
open; //运行到这里 报错
end;
错误提示为:EDBEngineError with message:capability not supported
什么意思啊??? 什么能力不支持请高手们指导
我想大概是你用的数据库不支持这种嵌套查询操作.
将 sql.add('select * from xsmc where xsxh_id not in (select xsxh_id from byqk) and zyh0=:id');
写在
parambyname('id').asstring:=dbgrid1.Fields[0].asstring;
后边即
parambyname('id').asstring:=dbgrid1.Fields[0].asstring;
sql.add('select * from xsmc where xsxh_id not in (select xsxh_id from byqk) and zyh0=:id');方案二:将id申明成一个变量,
sql.add('select * from xsmc where xsxh_id not in (select xsxh_id from byqk) and zyh0=:id');
改为
id:=dbgrid1.Fields[0].asstring;
sql.add('select * from xsmc where (xsxh_id not in (select xsxh_id from byqk)) and zyh0='''+id+'''');