home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / dbmsg / oledb / tablecopy / datasource.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-12  |  2.5 KB  |  101 lines

  1. //-----------------------------------------------------------------------------
  2. // Microsoft OLE DB TABLECOPY Sample
  3. // Copyright (C) 1995-1998 Microsoft Corporation
  4. //
  5. // @doc
  6. //
  7. // @module DATASOURCE.H
  8. //
  9. //-----------------------------------------------------------------------------
  10. #ifndef _DATASOURCE_H_
  11. #define _DATASOURCE_H_
  12.  
  13.  
  14. ///////////////////////////////////////////////////////////////
  15. // Includes
  16. //
  17. ///////////////////////////////////////////////////////////////
  18. #include "Property.h"
  19.  
  20.  
  21. //PROVIDERINFO
  22. struct PROVIDERINFO
  23. {
  24.     WCHAR            wszName[MAX_NAME_LEN];
  25.     WCHAR            wszParseName[MAX_NAME_LEN];
  26.     WCHAR            wszDescription[MAX_NAME_LEN];
  27.     DBTYPE            wType;
  28. };
  29.  
  30.  
  31.  
  32. /////////////////////////////////////////////////////////////////
  33. // CDataSource class
  34. //
  35. /////////////////////////////////////////////////////////////////
  36. class CDataSource
  37. {
  38. public:
  39.     //Constructors
  40.     CDataSource();
  41.     virtual ~CDataSource();
  42.  
  43.     //Members
  44.     virtual BOOL IsConnected();
  45.     virtual BOOL IsEqual(CDataSource* pCDataSource);
  46.     virtual BOOL IsSimilar(CDataSource* pCDataSource);
  47.     
  48.     virtual BOOL Connect(HWND hWnd, CDataSource* pCDataSource = NULL);
  49.     virtual BOOL Disconnect();
  50.  
  51.     virtual HRESULT GetProviders();
  52.     virtual HRESULT GetConnectionProps();
  53.  
  54.     //OLEDB Interfaces
  55.     IDBInitialize*        m_pIDBInitialize;        //DataSource interface
  56.     IOpenRowset*        m_pIOpenRowset;            //Session interface
  57.     IDBSchemaRowset*    m_pIDBSchemaRowset;        //Session interface
  58.     ITableDefinition*    m_pITableDefinition;    //Session interface
  59.     IIndexDefinition*    m_pIIndexDefinition;    //Session interface
  60.     ICommandText*        m_pICommandText;        //Command interface
  61.  
  62.     IParseDisplayName*    m_pIParseDisplayName;    //Enum interface
  63.  
  64.     //Catalog Schema info
  65.     WCHAR*                m_pwszCatalog;
  66.     WCHAR*                m_pwszCatalogTerm;
  67.     WCHAR*                m_pwszCatalogLocation;
  68.     WCHAR*                m_pwszSchemaTerm;
  69.     WCHAR*                m_pwszTableTerm;
  70.  
  71.     //DataSource info
  72.     ULONG                m_ulActiveSessions;
  73.     WCHAR*                m_pwszDataSource;
  74.     WCHAR*                m_pwszDBMS;
  75.     WCHAR*                m_pwszDBMSVer;
  76.     
  77.     //Provider info
  78.     WCHAR*                m_pwszProviderName;
  79.     WCHAR*                m_pwszProviderParseName;
  80.     WCHAR*                m_pwszProviderFileName;
  81.     WCHAR*                m_pwszProviderVer;
  82.     WCHAR*                m_pwszProviderOLEDBVer;
  83.  
  84.     //Enumerator ProvierInfo
  85.     ULONG                m_cProviderInfo;    
  86.     PROVIDERINFO*        m_rgProviderInfo;
  87.  
  88.     //Properties
  89.     BOOL                m_fReadOnly;
  90.     BOOL                m_fPrimaryKeysSupported;
  91.     BOOL                m_fMultipleParamSets;
  92.     BOOL                m_fIRowsetChange;
  93.     BOOL                m_fIRowsetUpdate;
  94.     ULONG                m_dwStorageObjects;
  95.  
  96.     BOOL                m_fConnected;
  97. };
  98.  
  99.  
  100. #endif    //_DATASOURCE_H_
  101.