Listing L
CDatabase::~CDatabase()
{
  HRESULT hr;

  // Check state of Recordset
  long nState;
  hr = m_iADOCERS->get_State(&nState);
  ASSERT(SUCCEEDED(hr));

  // Close the Recordset
  if(nState == adStateOpen)
  {
    hr = m_iADOCERS->Close();
    ASSERT(SUCCEEDED(hr));
  }

  // Close the Connection
  hr = m_iADOCEConn->Close();
  ASSERT(SUCCEEDED(hr));

  // Uninitalize the COM libraries
  CoUninitialize();
}