请个位帮我看看,怎么回事
在按钮的点击事件里
var maxid:integer;
begin
table1.insert;
with query1.create(nil) do
begin
try
close;
sql.add('select max(qt_id)+1 from qt');
open;
maxid:=fields[0].asinteger;
finally;
free;
dbedit5.text:=inttostr(maxid);
end;
end;
end;
这个当第一次执行的时候可以通过而且在DBEDIT5返回了最大值+1(注,其他记录没有添加),但是如果我想取消这次操作时,在点击另一个按扭的时候(这个按扭的作用是table.cancel)或者关闭这个窗体,然后在执行这个事件得时候,程序报错,内容市这样的
access ciolotion at address 00437e58 in module 'project2.exe' read of address FFFFFFF.
不知道我说的是否详细,请告诉我这是怎么回事,好吗,谢谢!!!!