Source code of Windows XP (NT5)
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.

103 lines
2.8 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // DataSource.h
  8. //
  9. // SYNOPSIS
  10. //
  11. // This file describes the class DataSource.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 11/05/1997 Original version.
  16. // 12/19/1997 Added ExecuteCommand method.
  17. // 01/15/1998 Implemented IIasComponent method.
  18. // 02/09/1998 Added AllowUpdate property.
  19. // 08/11/1998 Convert to IASTL.
  20. //
  21. ///////////////////////////////////////////////////////////////////////////////
  22. #ifndef _DATASOURCE_H_
  23. #define _DATASOURCE_H_
  24. #include <resource.h>
  25. #include <oledb.h>
  26. #include <iastl.h>
  27. #include <iastlb.h>
  28. ///////////////////////////////////////////////////////////////////////////////
  29. //
  30. // CLASS
  31. //
  32. // CIasDataSource
  33. //
  34. // DESCRIPTION
  35. //
  36. // This class implements the IIasDataSource and IDictionary interfaces.
  37. //
  38. ///////////////////////////////////////////////////////////////////////////////
  39. class ATL_NO_VTABLE CIasDataSource :
  40. public IASTL::IASComponent,
  41. public CComCoClass<CIasDataSource, &__uuidof(IasDataSource)>,
  42. public IIasDataSource
  43. {
  44. public:
  45. IAS_DECLARE_REGISTRY(IasDataSource, 1, 0, IASCoreLib)
  46. BEGIN_COM_MAP(CIasDataSource)
  47. COM_INTERFACE_ENTRY_IID(__uuidof(IIasDataSource), IIasDataSource)
  48. COM_INTERFACE_ENTRY_IID(__uuidof(IIasComponent), IIasComponent)
  49. COM_INTERFACE_ENTRY_IID(__uuidof(IDispatch), IDispatch)
  50. END_COM_MAP()
  51. CIasDataSource() throw ();
  52. ~CIasDataSource() throw ();
  53. //////////
  54. // IIasDataSource
  55. //////////
  56. STDMETHOD(put_Provider)(/*[in, string]*/ LPCWSTR newVal);
  57. STDMETHOD(get_Provider)(/*[out, retval, string]*/ LPWSTR* pVal);
  58. STDMETHOD(put_Name)(/*[in, string]*/ LPCWSTR newVal);
  59. STDMETHOD(get_Name)(/*[out, retval, string]*/ LPWSTR* pVal);
  60. STDMETHOD(put_UserID)(/*[in, string]*/ LPCWSTR newVal);
  61. STDMETHOD(get_UserID)(/*[out, retval, string]*/ LPWSTR* pVal);
  62. STDMETHOD(put_Password)(/*[in, string]*/ LPCWSTR newVal);
  63. STDMETHOD(get_Password)(/*[out, retval, string]*/ LPWSTR* pVal);
  64. STDMETHOD(put_AllowUpdate)(/*[in]*/ boolean newVal);
  65. STDMETHOD(get_AllowUpdate)(/*[out, retval]*/ boolean* pVal);
  66. STDMETHOD(OpenTable)(/*[in, string]*/ LPCWSTR szTableName,
  67. /*[out, retval]*/ IUnknown** ppTable);
  68. STDMETHOD(ExecuteCommand)(/*[in]*/ REFGUID rguidDialect,
  69. /*[in, string]*/ LPCWSTR szCommandText,
  70. /*[out, retval]*/ IUnknown** ppRowset);
  71. //////////
  72. // IIasComponent
  73. //////////
  74. STDMETHOD(Initialize)();
  75. STDMETHOD(Shutdown)();
  76. protected:
  77. HRESULT initStatus;
  78. wchar_t* provider;
  79. wchar_t* name;
  80. wchar_t* userID;
  81. wchar_t* password;
  82. bool allowUpdate;
  83. IDBInitialize* connection;
  84. IOpenRowset* session;
  85. };
  86. #endif // _DATASOURCE_H_