Memory leak using AddNew()

L

Louis

Hello,

I'm using the AddNew() function from CDaoRecordset with
Access 2000 and I have a memory leak problem. Here is my
source code:
---------------------------------------------

// The database m_Mydb is already open (CDaoDatabase)

CDaoRecordset oRecordSet(&m_Mydb);
CDaoQueryDef oQueryDef(&m_Mydb);

// Select all records from table [Data]
strQuery.Format("SELECT * FROM %s", "Data");

// Open recordset
oQueryDef.Create(NULL, strQuery);
oRecordSet.Open(&oQueryDef);

try
{
// Add a record
oRecordSet.AddNew();
oRecordSet.Update();
}
catch (CDaoException* pEx)
{
}
catch (CMemoryException* pEx)
{
}

// Close recordset
oRecordSet.Close();
oQueryDef.Close();
------------------------------------------------

When I loop several times on this code I found out
that the AddNew() function leaks some memory. If
someone has already encountered this problem please
let me know!

Thanks,

Louis
 
T

TC

What do you mean, it leaks some memory? What is the error or other affect
you are getting?

TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top