Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
5.0 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. // Inlines for AFXDB.H
  11. /////////////////////////////////////////////////////////////////////////////
  12. // General database inlines
  13. #ifdef _AFXDBCORE_INLINE
  14. // CDatabase inlines
  15. _AFXDBCORE_INLINE BOOL CDatabase::IsOpen() const
  16. { ASSERT_VALID(this); return m_hdbc != SQL_NULL_HDBC; }
  17. _AFXDBCORE_INLINE BOOL CDatabase::CanUpdate() const
  18. { ASSERT(IsOpen()); return m_bUpdatable; }
  19. _AFXDBCORE_INLINE BOOL CDatabase::CanTransact() const
  20. { ASSERT(IsOpen()); return m_bTransactions; }
  21. _AFXDBCORE_INLINE void CDatabase::SetLoginTimeout(DWORD dwSeconds)
  22. { ASSERT_VALID(this); m_dwLoginTimeout = dwSeconds; }
  23. _AFXDBCORE_INLINE void CDatabase::SetQueryTimeout(DWORD dwSeconds)
  24. { ASSERT_VALID(this); m_dwQueryTimeout = dwSeconds; }
  25. _AFXDBCORE_INLINE const CString& CDatabase::GetConnect() const
  26. { ASSERT_VALID(this); return m_strConnect; }
  27. _AFXDBCORE_INLINE DWORD CDatabase::GetBookmarkPersistence() const
  28. { ASSERT_VALID(this); return m_dwBookmarkAttributes; }
  29. _AFXDBCORE_INLINE int CDatabase::GetCursorCommitBehavior() const
  30. { ASSERT_VALID(this); return m_nCursorCommitBehavior; }
  31. _AFXDBCORE_INLINE int CDatabase::GetCursorRollbackBehavior() const
  32. { ASSERT_VALID(this); return m_nCursorRollbackBehavior; }
  33. _AFXDBCORE_INLINE void CDatabase::ThrowDBException(RETCODE nRetCode)
  34. { ASSERT_VALID(this); AfxThrowDBException(nRetCode, this, m_hstmt); }
  35. _AFXDBCORE_INLINE void CDatabase::SetSynchronousMode(BOOL /* bSynchronous */ )
  36. { ASSERT_VALID(this); TRACE0("Error: SetSynchronousMode is obsolete and has not effect.\n"); }
  37. // CRecordset inlines
  38. _AFXDBCORE_INLINE const CString& CRecordset::GetSQL() const
  39. { ASSERT(IsOpen()); return m_strSQL; }
  40. _AFXDBCORE_INLINE const CString& CRecordset::GetTableName() const
  41. { ASSERT(IsOpen()); return m_strTableName; }
  42. _AFXDBCORE_INLINE BOOL CRecordset::IsBOF() const
  43. { ASSERT(IsOpen()); return m_bBOF; }
  44. _AFXDBCORE_INLINE BOOL CRecordset::IsEOF() const
  45. { ASSERT(IsOpen()); return m_bEOF; }
  46. _AFXDBCORE_INLINE BOOL CRecordset::IsDeleted() const
  47. { ASSERT(IsOpen()); return m_bDeleted; }
  48. _AFXDBCORE_INLINE BOOL CRecordset::CanUpdate() const
  49. { ASSERT(IsOpen()); return m_bUpdatable; }
  50. _AFXDBCORE_INLINE BOOL CRecordset::CanScroll() const
  51. { ASSERT(IsOpen()); return m_bScrollable; }
  52. _AFXDBCORE_INLINE BOOL CRecordset::CanAppend() const
  53. { ASSERT(IsOpen()); return m_bAppendable; }
  54. _AFXDBCORE_INLINE BOOL CRecordset::CanRestart() const
  55. { ASSERT(IsOpen()); return !(m_dwOptions & executeDirect); }
  56. _AFXDBCORE_INLINE BOOL CRecordset::CanTransact() const
  57. { ASSERT(m_pDatabase->IsOpen());
  58. return m_pDatabase->m_bTransactions; }
  59. _AFXDBCORE_INLINE short CRecordset::GetODBCFieldCount() const
  60. { ASSERT(IsOpen()); return m_nResultCols; }
  61. _AFXDBCORE_INLINE DWORD CRecordset::GetRowsetSize() const
  62. { ASSERT(IsOpen()); return m_dwRowsetSize; }
  63. _AFXDBCORE_INLINE DWORD CRecordset::GetRowsFetched() const
  64. { ASSERT(IsOpen()); return m_dwRowsFetched; }
  65. _AFXDBCORE_INLINE WORD CRecordset::GetRowStatus(WORD wRow) const
  66. { ASSERT(IsOpen()); ASSERT(wRow > 0); return m_rgRowStatus[wRow-1]; }
  67. _AFXDBCORE_INLINE long CRecordset::GetRecordCount() const
  68. { ASSERT(IsOpen()); return m_lRecordCount; }
  69. _AFXDBCORE_INLINE void CRecordset::GetStatus(CRecordsetStatus& rStatus) const
  70. { ASSERT(IsOpen());
  71. rStatus.m_lCurrentRecord = m_lCurrentRecord;
  72. rStatus.m_bRecordCountFinal = m_bEOFSeen; }
  73. _AFXDBCORE_INLINE void CRecordset::ThrowDBException(RETCODE nRetCode, HSTMT hstmt)
  74. { ASSERT_VALID(this); AfxThrowDBException(nRetCode, m_pDatabase,
  75. (hstmt == SQL_NULL_HSTMT)? m_hstmt : hstmt); }
  76. _AFXDBCORE_INLINE void CRecordset::MoveNext()
  77. { ASSERT(IsOpen()); Move(1, SQL_FETCH_NEXT); }
  78. _AFXDBCORE_INLINE void CRecordset::MovePrev()
  79. { ASSERT(IsOpen()); Move(-1, SQL_FETCH_PRIOR); }
  80. _AFXDBCORE_INLINE void CRecordset::MoveFirst()
  81. { ASSERT(IsOpen()); Move(1, SQL_FETCH_FIRST); }
  82. _AFXDBCORE_INLINE void CRecordset::MoveLast()
  83. { ASSERT(IsOpen()); Move(-1, SQL_FETCH_LAST); }
  84. _AFXDBCORE_INLINE void CRecordset::SetAbsolutePosition(long nRows)
  85. { ASSERT(IsOpen()); Move(nRows, SQL_FETCH_ABSOLUTE); }
  86. #endif //_AFXDBCORE_INLINE
  87. #ifdef _AFXDBRFX_INLINE
  88. _AFXDBRFX_INLINE void CFieldExchange::SetFieldType(UINT nFieldType)
  89. { ASSERT(nFieldType == outputColumn ||
  90. nFieldType == inputParam ||
  91. nFieldType == outputParam ||
  92. nFieldType == inoutParam);
  93. m_nFieldType = nFieldType; }
  94. #endif //_AFXDBRFX_INLINE
  95. #ifdef _AFXDBVIEW_INLINE
  96. // CRecordView inlines
  97. _AFXDBVIEW_INLINE void CRecordView::OnMove(int cx, int cy)
  98. { CFormView::OnMove(cx, cy); }
  99. #endif
  100. /////////////////////////////////////////////////////////////////////////////