Re: ADODB Command memory leak



My logic is such that the connection to the database is not maintained
between calls to the Execute() method. Sorry I didn't mention that before.
My test involves these steps:

1. Create the connection object
2. Connect to the database
3. Create the command object
4. Create/Append command parameters
5. Execute the command
6. Destroy the command object
7. Close database connection
8. Go to step 2 for xxxx iterations
9. Destroy the connection object.

Thanks.


"Val Mazur (MVP)" wrote:

> Hi,
>
>
> See if it does not help
>
> http://support.microsoft.com/default.aspx?scid=kb;en-us;248014
>
> --
> Val Mazur
> Microsoft MVP
>
> http://xport.mvps.org
>
>
>
> "khalprin" <khalprin@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:ACD0680A-59E1-4179-BEA8-1AFF685C6441@xxxxxxxxxxxxxxxx
> > Hello,
> >
> > I'm tracking down a memory leak and have narrowed it down to the single
> > line
> > of my code that calls the Execute() method of the ADODB Command object.
> >
> > In this case, the Execute() is executing a query (that takes 2 parameters)
> > in MS Access that inserts 3 records into a table. I'm using the command
> > 'adCmdStoredProc' with the flag 'adExecuteNoRecords'. The command
> > executes
> > successfully and does not return a recordset pointer.
> >
> > When I run this through 1000s of iterations for my test, memory usage
> > grows
> > continuously. If I comment out the Execute() call, memory usage does not
> > grow.
> >
> > The command is setup as follows:
> >
> > pCmd->put_ActiveConnection(*pConn); // variant
> > pCmd->CommandText = szQuery; // name of query/stored proc
> > pCmd->CommandType = cmd; // ADODB command id
> >
> > The actual line of code that executes the command is:
> >
> > pCmd->Execute(NULL, NULL, cmd | ADODB::adExecuteNoRecords);
> >
> >
> > Any ideas?
> >
>
>
>
.



Relevant Pages

  • [Full-Disclosure] Advanced usage of system() function.
    ... and call its arguments as a command for shell. ... as we can see we still didnt get what we want (typing exit ... Connection closed by foreign host. ... think what we want to execute. ...
    (Full-Disclosure)
  • Advanced usage of system() function.
    ... and call its arguments as a command for shell. ... as we can see we still didnt get what we want (typing exit we are ... Connection closed by foreign host. ... think what we want to execute. ...
    (Bugtraq)
  • Re: ADODB Command memory leak
    ... _ConnectionPtr conn = NULL; ... // Execute statement. ... > My logic is such that the connection to the database is not maintained ... Create/Append command parameters ...
    (microsoft.public.data.ado)
  • Re: sp_help_job (HELP)
    ... it's defintely the Fill line that's causing this right? ... > The following code produces a "severe error occurred on the command ... problem (using the same connection id and pwd). ... I've tried to execute it ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: VBscript Timed out
    ... create a Command object and set the CommandTimeout property. ... Set connection = CreateObject ...
    (microsoft.public.sqlserver.programming)