🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #715

Re: Problem on memory leak with TADOQuery

#715
From: Sara T.
Date: Tue, 26 Jul 2005 16:40
95 lines
3254 bytes
I will try and let you the response.
But I don't understand why it could be worked.

Sara T.

"pieter" <pieter@nomail.com> wrote in message
news:42e65079$1@newsgroups.borland.com...
>
> Here is a way:
>
> Create a Connection class (Connection.cpp) with a TADOQuery and a method
like (not tested):
>
> Connection :: Connection ()
> {
>    //set your connection string here.
>    ADOQuery1->ConnectioString = ...
>    //Or you can set the connection string in de object inspector
> }
>
> TADOQuery *Connection :: open(String stmtSQL)
> {
>    try {
>       ADOQuery1->Close();
>       ADOQuery1->SQL->Clear();
>       ADOQuery->SQL->Add(stmtSQL);
>       ADOQuery1->Open();
>    } catch (Exception &e) {
>       ShowMessage (e.Message);
>    }
>    return ADOQuery1;
> }
>
> you can call this class by:
> //include header
> #include "Connection.h"
>
>
> TADOQuery *qry = new TADOQuery(Application);
> Connection *con = new Connection();
>
> String SQL = "SELECT * FROM myTable"
> qry = con->open(SQL);
> //do something with the query;
>
>
> //delete adoquery en connection
> delete qry;
> delete con;
>
> Good luck.
>
>
>
> "Sara T." <sarana@thaiquest.com> wrote:
> >I'm using an simple ADOQuery with:
> >AdoQuery1.Close;
> >AdoQuery1.Sql.Clear;
> >AdoQuery1.SQL.Add('select * from myTable');
> >AdoQuery1.Open;
> >
> >Every call I lose memory.
> >
> >I found the same question in Google but nobody answers.
> >
> >Sara T.
> >
> >"Pieter" <Pieter@nomail.com> wrote in message
> >news:42e62634$1@newsgroups.borland.com...
> >>
> >> It would be easier to tell something if you post some code.
> >> Pieter
> >>
> >> "Sara T." <sarana@thaiquest.com> wrote:
> >>>Does anybody find this?
> >>>
> >>>I have something to create and destroy this object (TADOQuery) a lot of
> >>>times, I found TADOQuery does not release the memory and eats memory
until
> >>>the machine becomes out of memory.
> >>>
> >>>I thought the several people found this problem (I search in the
google)
> >>>but
> >>>nobody answer.
> >>>
> >>>Again, it anybody finds the solutions, lindy post it.
> >>>
> >>>Sara T.
> >>>
> >>>
> >>
> >
> >
>
Technical Details
Message-ID: <42e667a0@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <42e4d1b3$1@newsgroups.borland.com> <42e62634$1@newsgroups.borland.com> <42e64264$1@newsgroups.borland.com> <42e65079$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,5b03d9688e33bc12
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Sara T." <sarana@infoquest.co.th>
From: "Sara T." <sarana@infoquest.co.th>
Newsgroups: borland.public.cppbuilder.database.ado
References:  <42e4d1b3$1@newsgroups.borland.com> <42e62634$1@newsgroups.borland.com> <42e64264$1@newsgroups.borland.com> <42e65079$1@newsgroups.borland.com>
Subject: Re: Problem on memory leak with TADOQuery
Date: Tue, 26 Jul 2005 23:40:55 +0700
Lines: 97
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
NNTP-Posting-Host: 61.91.131.220
Message-ID: <42e667a0@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1122396064 61.91.131.220 (26 Jul 2005 09:41:04 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news.moat.net!news-out.newsfeeds.com!propagator3-LAX.newsfeeds.com!news-in.superfeed.net!caladan.landsraad.net!newsgroups.borland.com!not-for-mail