home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / database / dbfetch / bulkset.h < prev    next >
C/C++ Source or Header  |  1998-03-26  |  3KB  |  83 lines

  1. // bulkset.h : header file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #define MAX_TEXT_LEN 40 // This is about as much as will fit in UI
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CBulkRecordsetMod recordset
  17.  
  18. class CBulkRecordsetMod : public CRecordset
  19. {
  20. public:
  21.     CBulkRecordsetMod(CDatabase* pDatabase = NULL);
  22.     DECLARE_DYNAMIC(CBulkRecordsetMod)
  23.  
  24. // Operations
  25. public:
  26.     virtual BOOL Open(UINT nOpenType = AFX_DB_USE_DEFAULT_TYPE,
  27.         LPCTSTR lpszSQL = NULL, DWORD dwOptions = useMultiRowFetch);
  28.  
  29.     virtual BOOL RowsetUpdate(WORD wRow, WORD wLockType = SQL_LOCK_NO_CHANGE);
  30.     virtual BOOL RowsetAdd(WORD wRow, WORD wLockType = SQL_LOCK_NO_CHANGE);
  31.     virtual BOOL RowsetDelete(WORD wRow, WORD wLockType = SQL_LOCK_NO_CHANGE);
  32.  
  33. // Implemenation
  34. public:
  35.     BOOL ValidateMod(WORD wRow, WORD wExpectedStatus);
  36. };
  37.  
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CDynamicBulkSet recordset
  40.  
  41. class CDynamicBulkSet : public CBulkRecordsetMod
  42. {
  43. public:
  44.     CDynamicBulkSet(CDatabase* pDatabase = NULL);
  45.     DECLARE_DYNAMIC(CDynamicBulkSet)
  46.  
  47.     virtual void Close();
  48.  
  49. // Attributes
  50.     int m_nAllocatedFields;
  51.     void** m_ppvData;    // allocate dynamically to nColumns later
  52.     void** m_ppvLengths; // allocate dynamically to nColumns later
  53.  
  54. // Overridables
  55.     virtual void DoBulkFieldExchange(CFieldExchange* pFX);
  56.     virtual void CheckRowsetError(RETCODE nRetCode);
  57. };
  58.  
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CTables - results from SQLTables (borrowed from Catalog2 sample)
  61.  
  62. class CTables : public CRecordset
  63. {
  64.     virtual CString GetDefaultConnect() { return ""; }
  65.     virtual CString GetDefaultSQL() { return ""; }
  66.  
  67. public:
  68.     CTables(CDatabase* pDatabase);
  69.     BOOL Open(LPCSTR pszTableQualifier = NULL,
  70.         LPCSTR pszTableOwner = NULL,
  71.         LPCSTR pszTableName = NULL,
  72.         LPCSTR pszTableType = NULL,
  73.         UINT nOpenType = forwardOnly);
  74.  
  75.     CString m_strTableQualifier;
  76.     CString m_strTableOwner;
  77.     CString m_strTableName;
  78.     CString m_strTableType;
  79.     CString m_strRemarks;
  80.  
  81.     virtual void DoFieldExchange(CFieldExchange*);
  82. };
  83.