运行这段代码出现Cannot perform this operation on an open dataset

运行这段代码出现Cannot perform this operation on an open dataset

题目
运行这段代码出现Cannot perform this operation on an open dataset
procedure Tfrm_in.edt_OKClick(Sender:TObject);
var y,m:String;
begin
y:=formatdatetime('yyyy',now);
m:=formatdatetime('m',now);
try
if (strtoint(edt_year.Text)>strtoint(y))or((strtoint(edt_year.Text)=strtoint(y))
and (strtoint(edt_month.Text)>=strtoint(m))) then
begin
showmessage('日期超前!');
exit;
end;
except
showmessage('请输入正确的月份!');
exit;
end;
month:='月进货'+edt_year.Text+'-'+edt_month.Text;
with data_month do
begin
commandtext:='select * from bookin where date like '+quotedstr(month+'-%');
active:=true;
end;
end;
答案

commandtext:='select * from bookin where date like '+quotedstr(month+'-%');
上面加上if active then Close; 试试
举一反三
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
1,人们染上烟瘾,最终因吸烟使自己丧命.
最新试题
热门考点

超级试练试题库

© 2017-2019 超级试练试题库,All Rights Reserved.