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.

94 lines
4.2 KiB

  1. // Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1993 Microsoft Corporation,
  3. // All rights reserved.
  4. // This source code is only intended as a supplement to the
  5. // Microsoft Foundation Classes Reference and Microsoft
  6. // QuickHelp and/or WinHelp documentation provided with the library.
  7. // See these sources for detailed information regarding the
  8. // Microsoft Foundation Classes product.
  9. // Inlines for AFXDB.H
  10. /////////////////////////////////////////////////////////////////////////////
  11. // General database inlines
  12. #ifdef _AFXDBCORE_INLINE
  13. // CDatabase inlines
  14. _AFXDBCORE_INLINE BOOL CDatabase::IsOpen() const
  15. { ASSERT_VALID(this); return m_hdbc != SQL_NULL_HDBC; }
  16. _AFXDBCORE_INLINE BOOL CDatabase::CanUpdate() const
  17. { ASSERT(IsOpen()); return m_bUpdatable; }
  18. _AFXDBCORE_INLINE BOOL CDatabase::CanTransact() const
  19. { ASSERT(IsOpen()); return m_bTransactions; }
  20. _AFXDBCORE_INLINE void CDatabase::SetLoginTimeout(DWORD dwSeconds)
  21. { ASSERT_VALID(this); m_dwLoginTimeout = dwSeconds; }
  22. _AFXDBCORE_INLINE void CDatabase::SetQueryTimeout(DWORD dwSeconds)
  23. { ASSERT_VALID(this); m_dwQueryTimeout = dwSeconds; }
  24. _AFXDBCORE_INLINE void CDatabase::SetSynchronousMode(BOOL bSynchronous)
  25. { ASSERT_VALID(this); m_bAsync = !bSynchronous; }
  26. _AFXDBCORE_INLINE const CString& CDatabase::GetConnect() const
  27. { ASSERT_VALID(this); return m_strConnect; }
  28. _AFXDBCORE_INLINE void CDatabase::ThrowDBException(RETCODE nRetCode)
  29. { ASSERT_VALID(this); AfxThrowDBException(nRetCode, this, m_hstmt); }
  30. // CRecordset inlines
  31. _AFXDBCORE_INLINE BOOL CRecordset::IsOpen() const
  32. { ASSERT_VALID(this); return m_hstmt != SQL_NULL_HSTMT; }
  33. _AFXDBCORE_INLINE const CString& CRecordset::GetSQL() const
  34. { ASSERT(IsOpen()); return m_strSQL; }
  35. _AFXDBCORE_INLINE const CString& CRecordset::GetTableName() const
  36. { ASSERT(IsOpen()); return m_strTableName; }
  37. _AFXDBCORE_INLINE BOOL CRecordset::IsBOF() const
  38. { ASSERT(IsOpen()); return m_bBOF; }
  39. _AFXDBCORE_INLINE BOOL CRecordset::IsEOF() const
  40. { ASSERT(IsOpen()); return m_bEOF; }
  41. _AFXDBCORE_INLINE BOOL CRecordset::IsDeleted() const
  42. { ASSERT(IsOpen()); return m_bDeleted; }
  43. _AFXDBCORE_INLINE BOOL CRecordset::CanUpdate() const
  44. { ASSERT(IsOpen()); return m_bUpdatable; }
  45. _AFXDBCORE_INLINE BOOL CRecordset::CanScroll() const
  46. { ASSERT(IsOpen()); return m_bScrollable; }
  47. _AFXDBCORE_INLINE BOOL CRecordset::CanAppend() const
  48. { ASSERT(IsOpen()); return m_bAppendable; }
  49. _AFXDBCORE_INLINE BOOL CRecordset::CanRestart() const
  50. { ASSERT(IsOpen()); return TRUE; }
  51. _AFXDBCORE_INLINE BOOL CRecordset::CanTransact() const
  52. { ASSERT(IsOpen());return m_pDatabase->m_bTransactions; }
  53. _AFXDBCORE_INLINE long CRecordset::GetRecordCount() const
  54. { ASSERT(IsOpen()); return m_lRecordCount; }
  55. _AFXDBCORE_INLINE void CRecordset::GetStatus(CRecordsetStatus& rStatus) const
  56. { ASSERT(IsOpen());
  57. rStatus.m_lCurrentRecord = m_lCurrentRecord;
  58. rStatus.m_bRecordCountFinal = m_bEOFSeen; }
  59. _AFXDBCORE_INLINE void CRecordset::ThrowDBException(RETCODE nRetCode, HSTMT hstmt)
  60. { ASSERT_VALID(this); AfxThrowDBException(nRetCode, m_pDatabase,
  61. (hstmt == SQL_NULL_HSTMT)? m_hstmt : hstmt); }
  62. _AFXDBCORE_INLINE void CRecordset::MoveNext()
  63. { ASSERT(IsOpen()); Move(AFX_MOVE_NEXT); }
  64. _AFXDBCORE_INLINE void CRecordset::MovePrev()
  65. { ASSERT(IsOpen()); Move(AFX_MOVE_PREVIOUS); }
  66. _AFXDBCORE_INLINE void CRecordset::MoveFirst()
  67. { ASSERT(IsOpen()); Move(AFX_MOVE_FIRST); }
  68. _AFXDBCORE_INLINE void CRecordset::MoveLast()
  69. { ASSERT(IsOpen()); Move(AFX_MOVE_LAST); }
  70. _AFXDBCORE_INLINE BOOL CRecordset::IsFieldFlagNull(UINT nColumn, UINT nFieldType)
  71. { ASSERT_VALID(this);
  72. return (GetFieldFlags(nColumn, nFieldType) & AFX_SQL_FIELD_FLAG_NULL) != 0; }
  73. _AFXDBCORE_INLINE BOOL CRecordset::IsFieldFlagDirty(UINT nColumn, UINT nFieldType)
  74. { ASSERT_VALID(this);
  75. return (GetFieldFlags(nColumn, nFieldType) & AFX_SQL_FIELD_FLAG_DIRTY) != 0; }
  76. #endif //_AFXDBCORE_INLINE
  77. #ifdef _AFXDBRFX_INLINE
  78. _AFXDBRFX_INLINE void CFieldExchange::SetFieldType(UINT nFieldType)
  79. { ASSERT(nFieldType == outputColumn || nFieldType == param);
  80. m_nFieldType = nFieldType; }
  81. #endif //_AFXDBRFX_INLINE
  82. /////////////////////////////////////////////////////////////////////////////