TAdoQuery not closing the connection ?
- From: OBones <obones_gfe_@xxxxxxxxxxxxxx>
- Date: Fri, 29 Apr 2005 12:05:47 +0200
Hi all.
I have this kind of code all over an application I have to take over:
procedure TStuff.Open;
begin
if not Assigned(ADOQuery) then
ADOQuery := TADOQuery.Create(nil);ADOQuery.ConnectionString := sConnectionString; ADOQuery.SQL.Text := sSQLQuery; ADOQuery.Prepared := true; ADOQuery.Open; ADOQuery.First; end;
procedure TStuff.Close; begin ADOQuery.Close; FreeAndNil(ADOQuery); end;
And other methods using the ADOQuery object. Then if I do this:
aStuff.Open; aStuff.GetResult; aStuff.Close;
the connecton to the Oracle is not released. I use Toad, and I still see it, and some of our users complain that this "kills" their database as we can have up to 16 connections per instance of the application.
I know it would be better to use a TADOConnection object shared by all the TADOQuery, but that is not feasible in the delay given to me (and partly because all this is scattered accross COM objects).
How then can I close those connections? Thanks a lot for your help
Olivier .
- Follow-Ups:
- Re: TAdoQuery not closing the connection ?
- From: OBones
- Re: TAdoQuery not closing the connection ?
- Prev by Date: Re: MS Access and Delphi?
- Next by Date: Re: MS Access and Delphi?
- Previous by thread: Emptying Table in ADO
- Next by thread: Re: TAdoQuery not closing the connection ?
- Index(es):
Relevant Pages
|