Home > Back-end >  ADOQuyer problem, consult
ADOQuyer problem, consult

Time:11-05

 
Procedure TForm1. Button2Click (Sender: TObject);
The begin
ADOQuery3. CacheSize:=1000;
ADOQuery3. CursorLocation:=clUseServer;//server mode
ADOQuery3. Open;
While not ADOQuery3. Eof do
The begin
Memo2. Lines. The Add (' 1 ');
ADOQuery3. Next;
end;
Memo2. Lines. The Add (" end ");
Adoquery3. Cancel;
ADOQuery3. Close;
ADOQuery3. Free;
ADOConnection1. Close;
ADOConnection1. Free;
end;

Code like this is very simple, but why when after loading the data, the native memory footprint is not released?? All normal close, use clUseClient won't have this problem, but my data volume is big, need to use clUseServer, and observe the oracle cursor open at this time also many, also did not release,

CodePudding user response:

Beg beg,

CodePudding user response:

Dynamically create a Adoquery try
Var
Ado_query: tadoquery;
The begin
Ado_query:=TADOQuery. Create (nil);

After use release

CodePudding user response:

refer to the second floor tangfuyou response:
dynamically create a Adoquery try
Var
Ado_query: tadoquery;
The begin
Ado_query:=TADOQuery. Create (nil);

After use release

Hello, tried this approach, is actually created dynamically, it found that memory is not released, only to ask, dynamic code and my code is essentially the same, are the problems of memory does not release,

CodePudding user response:

Large amount of data, need to use clUseServer, have how old? If back tens of thousands of the local data that is meaningless, even hundreds of thousands of local resource pressure is not too big, after all, now the hardware equipment has been curbed in
Search on the Internet about this setting more detailed example, hope to help you
http://www.accessoft.com/article-show.asp? Id=7407

CodePudding user response:

ADOQry. Close;
ADOQry. SQL. The Clear;
ADOQry. SQL. The Add (STR);
ADOQry. Open;