> 其他 >
运行这段代码出现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; 试试
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版