运行这段代码出现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;
人气:212 ℃ 时间:2020-02-06 04:51:07
解答
在
commandtext:='select * from bookin where date like '+quotedstr(month+'-%');
上面加上if active then Close; 试试
推荐
- cannot perform this operation on a closed dataset.
- cannot perform this operation on a closed dataset英文怎么读?是什么意思?
- 高锰酸钾分解制取氧气的实验中,试管口放置蓬松棉花团的目的是什么?
- 能不能用巧算的方式来计算2的22次方
- 0,1,1,3,4,5,8,(),()怎么填,有什么规律,急
- 已知x=-2/5,则 (5x平方-5x+1)-(5-20x平方)的值为
- 看到翟志刚在太空行走,你心里想些什么?
- 简便计算:199*201-198^2
猜你喜欢