代码如下:
while not query.eof do
begin
s:='update table set ....'
query.sql.clear;
query.sql.add(s);
query.execsql;
query.next; //到这一步就异常,提示不能操作关闭的数据集
end;
请大家看看有什么问题
while not query.eof do
begin
s:='update table set ....'
query.sql.clear;
query.sql.add(s);
query.execsql;
query.next; //到这一步就异常,提示不能操作关闭的数据集
end;
请大家看看有什么问题
用两个试试
----------------------------------------------------------------
花自飘零水自流,一种相思,两处闲愁。
此情无计可消除,才下眉头,又上心头。
----------------------------------------------------------------
(select c1c2c3.c1,c1c2c3.c2 from c1c2c3,yb1 where yb1.c1=c1c2c3.c1
union
select c1,0 as c2 from yb1 where c1 not in
(select c1 from c1c2c3)) b
where yb1.c1=b.c1);数据更新用上面这里,没必要while not query.eof do.