
CRecordset Access Violation
Please help.
We get the following exception:
0x0000005 Access violation in ODBCCR32.DLL
when we attempt to close a recordset (that we
ensure is open).
This is with VC++ V5 under NT 4.0 (using Oracle 7 or 8).
It appears that the m_hstmt value is invalid
when the call to SQLFreeStmt is called, causing the access violation.
Thanks for any help!
john
void CRecordset::Close()
{
ASSERT_VALID(this);
.
.
.
.
RETCODE nRetCode;
if (m_hstmt != SQL_NULL_HSTMT)
{
AFX_SQL_SYNC(::SQLFreeStmt(m_hstmt, SQL_DROP));
m_hstmt = SQL_NULL_HSTMT;
}