SQLRETURN sqlFreeConnect( SQLHDBC hDrvDbc ) { HDRVDBC hDbc = (HDRVDBC)hDrvDbc; int nReturn; /* SANITY CHECKS */ if( NULL == hDbc ) return SQL_INVALID_HANDLE; sprintf( hDbc->szSqlMsg, "hDbc = $%08lX", hDbc ); logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, hDbc->szSqlMsg ); if( hDbc->hDbcExtras->hServer > -1 ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Connection is active" ); return SQL_ERROR; } if ( hDbc->hFirstStmt != NULL ) { logPushMsg( hDbc->hLog, __FILE__, __FILE__, __LINE__, LOG_WARNING, LOG_WARNING, "SQL_ERROR Connection has allocated statements" ); return SQL_ERROR; } nReturn = _FreeDbc( hDbc ); return nReturn; }
SQLRETURN _FreeDbcList( SQLHENV hDrvEnv ) { HDRVENV hEnv = (HDRVENV)hDrvEnv; if ( hEnv == SQL_NULL_HENV ) return SQL_SUCCESS; while ( _FreeDbc( hEnv->hFirstDbc ) == SQL_SUCCESS ) { } return SQL_SUCCESS; }