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
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