一段很简单的程序
with qry1 do
begin
close;
sql.Clear ;
sql.Add('select * from xsmc where xsxh_id=:id');
parambyname('id').asstring:=xsdatemp.edit1.text;// 报错
open;
end;raised exception class EAccessViolation with message'Access
violation at address 005bfb5d in module 'xjgl.exe',read of
address 000002fc. process stopped.为什么会出现这样的错误呢?? 急啊!!!!!!!!
with qry1 do
begin
close;
sql.Clear ;
sql.Add('select * from xsmc where xsxh_id=:id');
parambyname('id').asstring:=xsdatemp.edit1.text;// 报错
open;
end;raised exception class EAccessViolation with message'Access
violation at address 005bfb5d in module 'xjgl.exe',read of
address 000002fc. process stopped.为什么会出现这样的错误呢?? 急啊!!!!!!!!
迷茫ing
如果 xsdatemp 就是你现在的这个窗体的话,建议你把它去掉,也就是
parambyname('id').asstring:=edit1.text;如果不是这个窗体,那么可能是 xsdatemp 开没有创建,或者是创建之后被 free 掉了。