DATASOURCE.H
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:3k
源码类别:

Windows编程

开发平台:

Visual C++

  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. // Includes
  14. //
  15. ///////////////////////////////////////////////////////////////
  16. #include "Property.h"
  17. //PROVIDERINFO
  18. struct PROVIDERINFO
  19. {
  20. WCHAR wszName[MAX_NAME_LEN];
  21. WCHAR wszParseName[MAX_NAME_LEN];
  22. WCHAR wszDescription[MAX_NAME_LEN];
  23. DBTYPE wType;
  24. };
  25. /////////////////////////////////////////////////////////////////
  26. // CDataSource class
  27. //
  28. /////////////////////////////////////////////////////////////////
  29. class CDataSource
  30. {
  31. public:
  32. //Constructors
  33. CDataSource();
  34. virtual ~CDataSource();
  35. //Members
  36. virtual BOOL IsConnected();
  37. virtual BOOL IsEqual(CDataSource* pCDataSource);
  38. virtual BOOL IsSimilar(CDataSource* pCDataSource);
  39. virtual BOOL Connect(HWND hWnd, CDataSource* pCDataSource = NULL);
  40. virtual BOOL Disconnect();
  41. virtual HRESULT GetProviders();
  42. virtual HRESULT GetConnectionProps();
  43. //OLEDB Interfaces
  44. IDBInitialize* m_pIDBInitialize; //DataSource interface
  45. IOpenRowset* m_pIOpenRowset; //Session interface
  46. IDBSchemaRowset* m_pIDBSchemaRowset; //Session interface
  47. ITableDefinition* m_pITableDefinition; //Session interface
  48. IIndexDefinition* m_pIIndexDefinition; //Session interface
  49. ICommandText* m_pICommandText; //Command interface
  50. IParseDisplayName* m_pIParseDisplayName; //Enum interface
  51. //Catalog Schema info
  52. WCHAR* m_pwszCatalog;
  53. WCHAR* m_pwszCatalogTerm;
  54. WCHAR* m_pwszCatalogLocation;
  55. WCHAR* m_pwszSchemaTerm;
  56. WCHAR* m_pwszTableTerm;
  57. //DataSource info
  58. ULONG m_ulActiveSessions;
  59. WCHAR* m_pwszDataSource;
  60. WCHAR* m_pwszDBMS;
  61. WCHAR* m_pwszDBMSVer;
  62. //Provider info
  63. WCHAR* m_pwszProviderName;
  64. WCHAR* m_pwszProviderParseName;
  65. WCHAR* m_pwszProviderFileName;
  66. WCHAR* m_pwszProviderVer;
  67. WCHAR* m_pwszProviderOLEDBVer;
  68. //Enumerator ProvierInfo
  69. ULONG m_cProviderInfo;
  70. PROVIDERINFO* m_rgProviderInfo;
  71. //Properties
  72. BOOL m_fReadOnly;
  73. BOOL m_fPrimaryKeysSupported;
  74. BOOL m_fMultipleParamSets;
  75. BOOL m_fIRowsetChange;
  76. BOOL m_fIRowsetUpdate;
  77. ULONG m_dwStorageObjects;
  78. BOOL m_fConnected;
  79. };
  80. #endif //_DATASOURCE_H_