Category : ado

In the following code scenario, after calling func1() a memory leak is observed. CoUninitialize() was expected to release that memory. But I guess that’s not happening. Is there anything more to add? void TestDBConnections(){ int iErrorCode = 0; _ConnectionPtr m_pConnection; HRESULT hr; try { TESTHR(hr = m_pConnection.CreateInstance(__uuidof(Connection))); if (SUCCEEDED(hr)) { _bstr_t sCS("DSN=xxxxx;UID=xxxxx;PWD=xxxxx;Provider=SQLNCLI11;Driver={SQL Server Native Client ..

Read more

Im having issues adding the MS ADO type libraries into a large established MFC C++ project. Im using MS VS2015 for this project and the import directive im using is as follows: #import "C:Program FilesCommon FilesSystemadomsado28.tlb" rename_namespace("ADO_CG") rename("EOF","EndOfFile") Originally I made a blank test project to create basic functionality and it was working great. I ..

Read more

When connecting to a database my program sometimes runs into an exception (_com_error – E_OUTOFMEMORY). This happens after I closed the database and reopens it, which I do once every 24h. As my program runs 24/24, doing moderate database access, this is not acceptable. I wrote a small console program to test the opening and ..

Read more