Strange error in CDatabase::Close()???
-
Hi, if i debug my application, and want to close them, i receive sometimes this strange error in
// Disconnect connection
void CDatabase::Close()
{
ASSERT_VALID(this);// Close any open recordsets AfxLockGlobals(CRIT\_ODBC); TRY { while (!m\_listRecordsets.IsEmpty()) { CRecordset\* pSet = (CRecordset\*)m\_listRecordsets.GetHead(); pSet->Close(); // will implicitly remove from list pSet->m\_pDatabase = NULL; } } CATCH\_ALL(e) { AfxUnlockGlobals(CRIT\_ODBC); THROW\_LAST(); } END\_CATCH\_ALL AfxUnlockGlobals(CRIT\_ODBC); if (m\_hdbc != SQL\_NULL\_HDBC) { RETCODE nRetCode; AFX\_SQL\_SYNC(::SQLDisconnect(m\_hdbc)); **// here is error???** AFX\_SQL\_SYNC(::SQLFreeConnect(m\_hdbc)); m\_hdbc = SQL\_NULL\_HDBC; \_AFX\_DB\_STATE\* pDbState = \_afxDbState; AfxLockGlobals(CRIT\_ODBC); ASSERT(pDbState->m\_nAllocatedConnections != 0); pDbState->m\_nAllocatedConnections--; AfxUnlockGlobals(CRIT\_ODBC); }
}
But the best is i dont habe any kind of database in my project included???? Does any one have a answer for this issue??? thanks for any help! Arrin
-
Hi, if i debug my application, and want to close them, i receive sometimes this strange error in
// Disconnect connection
void CDatabase::Close()
{
ASSERT_VALID(this);// Close any open recordsets AfxLockGlobals(CRIT\_ODBC); TRY { while (!m\_listRecordsets.IsEmpty()) { CRecordset\* pSet = (CRecordset\*)m\_listRecordsets.GetHead(); pSet->Close(); // will implicitly remove from list pSet->m\_pDatabase = NULL; } } CATCH\_ALL(e) { AfxUnlockGlobals(CRIT\_ODBC); THROW\_LAST(); } END\_CATCH\_ALL AfxUnlockGlobals(CRIT\_ODBC); if (m\_hdbc != SQL\_NULL\_HDBC) { RETCODE nRetCode; AFX\_SQL\_SYNC(::SQLDisconnect(m\_hdbc)); **// here is error???** AFX\_SQL\_SYNC(::SQLFreeConnect(m\_hdbc)); m\_hdbc = SQL\_NULL\_HDBC; \_AFX\_DB\_STATE\* pDbState = \_afxDbState; AfxLockGlobals(CRIT\_ODBC); ASSERT(pDbState->m\_nAllocatedConnections != 0); pDbState->m\_nAllocatedConnections--; AfxUnlockGlobals(CRIT\_ODBC); }
}
But the best is i dont habe any kind of database in my project included???? Does any one have a answer for this issue??? thanks for any help! Arrin
Look at the call stack and you can figure out the sequence of functions that are being called. From this you can understand how the control reached that particular function.
«_Superman_» I love work. It gives me something to do between weekends.
-
Look at the call stack and you can figure out the sequence of functions that are being called. From this you can understand how the control reached that particular function.
«_Superman_» I love work. It gives me something to do between weekends.