初
初学者1
Unregistered / Unconfirmed
GUEST, unregistred user!
我做了一个二次检索的例子:
button1click://一次检索
adoquery1.close;
adoquery1.SQL.clear;
adoquery1.sql.add('select * from A where correctrate>=');
adoquery1.sql.add(''''+edit1.text+'''');
adoquery1.open;
button2click://二次检索
adoquery2.close;
adoquery2.SQL.clear;
adoquery2.sql.add('select * from ');
adoquery2.sql.add('('+adoquery1.sql.text+')');
adoquery2.SQL.add(' As r where IDID=');
adoquery2.sql.add(''''+edit2.text+'''');
adoquery2.open;
当我一次检索完进行二次检索,没问题。但是我在返回来进行一次检索,报错:
can't perform this operation on a closed dataset.
但我把adoquery1.close改为adoquery1.open
它又报错:
can't perform this operation on a open dataset.
这是why?
button1click://一次检索
adoquery1.close;
adoquery1.SQL.clear;
adoquery1.sql.add('select * from A where correctrate>=');
adoquery1.sql.add(''''+edit1.text+'''');
adoquery1.open;
button2click://二次检索
adoquery2.close;
adoquery2.SQL.clear;
adoquery2.sql.add('select * from ');
adoquery2.sql.add('('+adoquery1.sql.text+')');
adoquery2.SQL.add(' As r where IDID=');
adoquery2.sql.add(''''+edit2.text+'''');
adoquery2.open;
当我一次检索完进行二次检索,没问题。但是我在返回来进行一次检索,报错:
can't perform this operation on a closed dataset.
但我把adoquery1.close改为adoquery1.open
它又报错:
can't perform this operation on a open dataset.
这是why?