我在我的程序中使用了query,database控件,在使用的过程中时间长一点就会出现“没有足够内存……的问题”(错误是英文的,我没记下来,大概是这个意思,相信大家都遇到过吧)我在程序中已经添加了下面这段话,为什么还不能断开和数据库的联系啊??请各位高手指教~~~~~~~procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
if query1.Active then
query1.Active:=false;
if Database1.Connected then
Database1.Connected:=false;
application.Terminate;
end;
begin
if query1.Active then
query1.Active:=false;
if Database1.Connected then
Database1.Connected:=false;
application.Terminate;
end;
if query1.Active then
begin
query1.close;
end;
if Database1.Connected then
Database1.Connected:=false;
application.Terminate;
你好,你的建议我还没有尝试,因为它并不是一下两下就能试出来的:( 我想问一下,他们有什么区别吗??也就是close与active:=***。
我上面的程序是在窗体关闭的时候执行的,那么即使前面有一些没有关闭的控件,这样不也就关了吗??我只使用了一个query,一个database控件。