在
commandtext:='select * from bookin where date like '+quotedstr(month+'-%');
上面加上if active then Close; 试试
运行这段代码出现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;
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;
其他人气:488 ℃时间:2020-02-06 04:51:07
优质解答
我来回答
类似推荐
猜你喜欢
- 1-a的2x-1次方b的4次方与1/3a的8次方b的4次方是同类项,求(1-x)100次方(x-59/14)的值
- 2等比数列 已知a5=4,a7=6,求a9和a3?
- 3形容一个人在开会时说话的气势的成语有哪些?
- 4仍然是:唯一的听众 练习题
- 5我国古代自唐中晚期到宋朝,南方经济得以持续发展,超过北方,又具备了哪些因素?
- 6描写物品东西的作文 (100字)
- 7BEIJING(Xinhua)-Chinese have started to enjoy cars at low prices after the country became a member of the World Trade Or
- 8在这个世界上发现就是成功之母这句话的理解是
- 9i will finish the( )《draw》next week and then i will take them to my office.
- 10统计学的计算题