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.

1429 lines
36 KiB

  1. // This is a part of the Active Template Library.
  2. // Copyright (C) 1996-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Active Template Library Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Active Template Library product.
  10. ///////////////////////////////////////////////////////////////////////////
  11. // ATLDBSCH.H : Declarations for OLE DB Schema Rowset Consumer Support
  12. //
  13. #ifndef __ATLDBSCH_H__
  14. #define __ATLDBSCH_H__
  15. namespace ATL
  16. {
  17. template <ULONG nRestrictions>
  18. class _CStoreRestrictions
  19. {
  20. public:
  21. _CStoreRestrictions()
  22. {
  23. m_pvarRestrictions = NULL;
  24. ATLTRY(m_pvarRestrictions = new CComVariant[nRestrictions]);
  25. }
  26. ~_CStoreRestrictions()
  27. {
  28. delete [] m_pvarRestrictions;
  29. }
  30. HRESULT GetRowset(const CSession& session, const GUID& guidSchema, IRowset** ppRowset)
  31. {
  32. ATLASSERT(session.m_spOpenRowset != NULL);
  33. CComPtr<IDBSchemaRowset> spSchemaRowset;
  34. HRESULT hr;
  35. hr = session.m_spOpenRowset->QueryInterface(IID_IDBSchemaRowset, (void**)&spSchemaRowset);
  36. if (FAILED(hr))
  37. return hr;
  38. return spSchemaRowset->GetRowset(NULL, guidSchema, nRestrictions,
  39. m_pvarRestrictions, IID_IRowset, 0, NULL, (IUnknown**)ppRowset);
  40. }
  41. CComVariant* m_pvarRestrictions;
  42. };
  43. template <>
  44. class _CStoreRestrictions<0>
  45. {
  46. public:
  47. HRESULT GetRowset(const CSession& session, const GUID& guidSchema, IRowset** ppRowset)
  48. {
  49. ATLASSERT(session.m_spOpenRowset != NULL);
  50. CComPtr<IDBSchemaRowset> spSchemaRowset;
  51. HRESULT hr;
  52. hr = session.m_spOpenRowset->QueryInterface(IID_IDBSchemaRowset, (void**)&spSchemaRowset);
  53. if (FAILED(hr))
  54. return hr;
  55. return spSchemaRowset->GetRowset(NULL, guidSchema, 0,
  56. NULL, IID_IRowset, 0, NULL, (IUnknown**)ppRowset);
  57. }
  58. };
  59. ///////////////////////////////////////////////////////////////////////////
  60. // class CSchemaRowset
  61. template <class T, short nRestrictions>
  62. class CSchemaRowset :
  63. public CAccessorRowset<T, CRowset>,
  64. public _CStoreRestrictions<nRestrictions>
  65. {
  66. public:
  67. // Operations
  68. HRESULT Open(const CSession& session, const GUID& guidSchema)
  69. {
  70. HRESULT hr;
  71. hr = GetRowset(session, guidSchema, &m_spRowset);
  72. if (SUCCEEDED(hr))
  73. hr = Bind();
  74. return hr;
  75. }
  76. };
  77. ///////////////////////////////////////////////////////////////////////////
  78. // class CRestrictions
  79. template <class T, short nRestrictions, const GUID* pguid>
  80. class CRestrictions : public CSchemaRowset<T, nRestrictions>
  81. {
  82. public:
  83. HRESULT Open(const CSession& session, LPCTSTR lpszParam1 = NULL, LPCTSTR lpszParam2 = NULL,
  84. LPCTSTR lpszParam3 = NULL, LPCTSTR lpszParam4 = NULL,
  85. LPCTSTR lpszParam5 = NULL, LPCTSTR lpszParam6 = NULL,
  86. LPCTSTR lpszParam7 = NULL)
  87. {
  88. USES_CONVERSION;
  89. CComVariant* pVariant;
  90. if (m_pvarRestrictions == NULL)
  91. return E_OUTOFMEMORY;
  92. if (lpszParam1 != NULL)
  93. {
  94. m_pvarRestrictions->vt = VT_BSTR;
  95. m_pvarRestrictions->bstrVal = ::SysAllocString(T2COLE(lpszParam1));
  96. }
  97. if (lpszParam2 != NULL)
  98. {
  99. pVariant = m_pvarRestrictions + 1;
  100. pVariant->vt = VT_BSTR;
  101. pVariant->bstrVal = ::SysAllocString(T2COLE(lpszParam2));
  102. }
  103. if (lpszParam3 != NULL)
  104. {
  105. pVariant = m_pvarRestrictions + 2;
  106. pVariant->vt = VT_BSTR;
  107. pVariant->bstrVal = ::SysAllocString(T2COLE(lpszParam3));
  108. }
  109. if (lpszParam4 != NULL)
  110. {
  111. pVariant = m_pvarRestrictions + 3;
  112. pVariant->vt = VT_BSTR;
  113. pVariant->bstrVal = ::SysAllocString(T2COLE(lpszParam4));
  114. }
  115. if (lpszParam5 != NULL)
  116. {
  117. pVariant = m_pvarRestrictions + 4;
  118. pVariant->vt = VT_BSTR;
  119. pVariant->bstrVal = ::SysAllocString(T2COLE(lpszParam5));
  120. }
  121. if (lpszParam6 != NULL)
  122. {
  123. pVariant = m_pvarRestrictions + 5;
  124. pVariant->vt = VT_BSTR;
  125. pVariant->bstrVal = ::SysAllocString(T2COLE(lpszParam6));
  126. }
  127. if (lpszParam7 != NULL)
  128. {
  129. pVariant = m_pvarRestrictions + 6;
  130. pVariant->vt = VT_BSTR;
  131. pVariant->bstrVal = ::SysAllocString(T2COLE(lpszParam7));
  132. }
  133. return CSchemaRowset<T, nRestrictions>::Open(session, *pguid);
  134. }
  135. };
  136. ///////////////////////////////////////////////////////////////////////////
  137. // CSchemas
  138. class CSchemas
  139. {
  140. public:
  141. CSchemas()
  142. {
  143. m_nSchemas = 0;
  144. m_pSchemaGuids = NULL;
  145. m_pulRestrictions = NULL;
  146. };
  147. ~CSchemas()
  148. {
  149. // Clean up allocated memory
  150. if (m_pSchemaGuids != NULL)
  151. {
  152. CoTaskMemFree(m_pSchemaGuids);
  153. CoTaskMemFree(m_pulRestrictions);
  154. }
  155. };
  156. // Operations
  157. HRESULT GetSchemas(const CSession& session)
  158. {
  159. CComPtr<IDBSchemaRowset> spSchemaRowset;
  160. HRESULT hr;
  161. ATLASSERT(session.m_spOpenRowset != NULL);
  162. hr = session.m_spOpenRowset->QueryInterface(IID_IDBSchemaRowset,
  163. (void**)&spSchemaRowset);
  164. if (FAILED(hr))
  165. return hr;
  166. return spSchemaRowset->GetSchemas(&m_nSchemas, &m_pSchemaGuids,
  167. &m_pulRestrictions);
  168. };
  169. // Attributes
  170. ULONG m_nSchemas;
  171. LPGUID m_pSchemaGuids;
  172. ULONG* m_pulRestrictions;
  173. };
  174. ///////////////////////////////////////////////////////////////////////////
  175. // CAssertionInfo
  176. class CAssertionInfo
  177. {
  178. public:
  179. CAssertionInfo()
  180. {
  181. memset(this, 0, sizeof(*this));
  182. }
  183. // Attributes
  184. TCHAR m_szCatalog[129];
  185. TCHAR m_szSchema[129];
  186. TCHAR m_szName[129];
  187. VARIANT_BOOL m_bIsDeferrable;
  188. VARIANT_BOOL m_bInitiallyDeferred;
  189. TCHAR m_szDescription[129];
  190. // Binding Map
  191. BEGIN_COLUMN_MAP(CAssertionInfo)
  192. COLUMN_ENTRY(1, m_szCatalog)
  193. COLUMN_ENTRY(2, m_szSchema)
  194. COLUMN_ENTRY(3, m_szName)
  195. COLUMN_ENTRY(4, m_bIsDeferrable)
  196. COLUMN_ENTRY(5, m_bInitiallyDeferred)
  197. COLUMN_ENTRY(6, m_szDescription)
  198. END_COLUMN_MAP()
  199. };
  200. ///////////////////////////////////////////////////////////////////////////
  201. // class CCatalogInfo
  202. class CCatalogInfo
  203. {
  204. public:
  205. CCatalogInfo()
  206. {
  207. memset(this, 0, sizeof(*this));
  208. }
  209. // Attributes
  210. TCHAR m_szName[129];
  211. TCHAR m_szDescription[129];
  212. // Binding Info
  213. BEGIN_COLUMN_MAP(CCatalogInfo)
  214. COLUMN_ENTRY(1, m_szName)
  215. COLUMN_ENTRY(2, m_szDescription)
  216. END_COLUMN_MAP()
  217. };
  218. ///////////////////////////////////////////////////////////////////////////
  219. // class CCharacterSetInfo
  220. class CCharacterSetInfo
  221. {
  222. public:
  223. CCharacterSetInfo()
  224. {
  225. memset(this, 0, sizeof(*this));
  226. }
  227. // Attributes
  228. TCHAR m_szCatalog[129];
  229. TCHAR m_szSchema[129];
  230. TCHAR m_szName[129];
  231. TCHAR m_szFormOfUse[129];
  232. LARGE_INTEGER m_nNumCharacters;
  233. TCHAR m_szCollateCatalog[129];
  234. TCHAR m_szCollateSchema[129];
  235. TCHAR m_szCollateName[129];
  236. // Binding Info
  237. BEGIN_COLUMN_MAP(CCharacterSetInfo)
  238. COLUMN_ENTRY(1, m_szCatalog)
  239. COLUMN_ENTRY(2, m_szSchema)
  240. COLUMN_ENTRY(3, m_szName)
  241. COLUMN_ENTRY(4, m_szFormOfUse)
  242. COLUMN_ENTRY(5, m_nNumCharacters)
  243. COLUMN_ENTRY(6, m_szCollateCatalog)
  244. COLUMN_ENTRY(7, m_szCollateSchema)
  245. COLUMN_ENTRY(8, m_szCollateName)
  246. END_COLUMN_MAP()
  247. };
  248. ///////////////////////////////////////////////////////////////////////////
  249. // class CCheckConstraintInfo
  250. class CCheckConstraintInfo
  251. {
  252. public:
  253. CCheckConstraintInfo()
  254. {
  255. memset(this, 0, sizeof(*this));
  256. }
  257. // Attributes
  258. TCHAR m_szCatalog[129];
  259. TCHAR m_szSchema[129];
  260. TCHAR m_szName[129];
  261. TCHAR m_szCheckClause[129];
  262. TCHAR m_szDescription[129];
  263. // Binding Maps
  264. BEGIN_COLUMN_MAP(CCheckConstraintInfo)
  265. COLUMN_ENTRY(1, m_szCatalog)
  266. COLUMN_ENTRY(2, m_szSchema)
  267. COLUMN_ENTRY(3, m_szName)
  268. COLUMN_ENTRY(4, m_szCheckClause)
  269. COLUMN_ENTRY(5, m_szDescription)
  270. END_COLUMN_MAP()
  271. };
  272. ///////////////////////////////////////////////////////////////////////////
  273. // class CCollationInfo
  274. class CCollationInfo
  275. {
  276. public:
  277. // Constructors
  278. CCollationInfo()
  279. {
  280. memset(this, 0, sizeof(*this));
  281. }
  282. // Attributes
  283. TCHAR m_szCatalog[129];
  284. TCHAR m_szSchema[129];
  285. TCHAR m_szName[129];
  286. TCHAR m_szCharSetCatalog[129];
  287. TCHAR m_szCharSetSchema[129];
  288. TCHAR m_szCharSetName[129];
  289. TCHAR m_szPadAttribute[10];
  290. // Binding Maps
  291. BEGIN_COLUMN_MAP(CCollationInfo)
  292. COLUMN_ENTRY(1, m_szCatalog)
  293. COLUMN_ENTRY(2, m_szSchema)
  294. COLUMN_ENTRY(3, m_szName)
  295. COLUMN_ENTRY(4, m_szCharSetCatalog)
  296. COLUMN_ENTRY(5, m_szCharSetSchema)
  297. COLUMN_ENTRY(6, m_szCharSetName)
  298. COLUMN_ENTRY(7, m_szPadAttribute)
  299. END_COLUMN_MAP()
  300. };
  301. ///////////////////////////////////////////////////////////////////////////
  302. // class CColumnDomainUsageInfo
  303. class CColumnDomainUsageInfo
  304. {
  305. public:
  306. // Constructor
  307. CColumnDomainUsageInfo()
  308. {
  309. memset(this, 0, sizeof(*this));
  310. }
  311. // Attributes
  312. TCHAR m_szCatalog[129];
  313. TCHAR m_szSchema[129];
  314. TCHAR m_szName[129];
  315. TCHAR m_szTableCatalog[129];
  316. TCHAR m_szTableSchema[129];
  317. TCHAR m_szTableName[129];
  318. TCHAR m_szColumnName[129];
  319. GUID m_guidColumn;
  320. ULONG m_nColumnPropID;
  321. // Binding Maps
  322. BEGIN_COLUMN_MAP(CColumnDomainUsageInfo)
  323. COLUMN_ENTRY(1, m_szCatalog)
  324. COLUMN_ENTRY(2, m_szSchema)
  325. COLUMN_ENTRY(3, m_szName)
  326. COLUMN_ENTRY(4, m_szTableCatalog)
  327. COLUMN_ENTRY(5, m_szTableSchema)
  328. COLUMN_ENTRY(6, m_szTableName)
  329. COLUMN_ENTRY(7, m_szColumnName)
  330. COLUMN_ENTRY(8, m_guidColumn)
  331. COLUMN_ENTRY(9, m_nColumnPropID)
  332. END_COLUMN_MAP()
  333. };
  334. ///////////////////////////////////////////////////////////////////////////
  335. // class CColumnPrivilegeInfo
  336. class CColumnPrivilegeInfo
  337. {
  338. public:
  339. // Constructor
  340. CColumnPrivilegeInfo()
  341. {
  342. memset(this, 0, sizeof(*this));
  343. }
  344. // Attributes
  345. TCHAR m_szGrantor[129];
  346. TCHAR m_szGrantee[129];
  347. TCHAR m_szTableCatalog[129];
  348. TCHAR m_szTableSchema[129];
  349. TCHAR m_szTableName[129];
  350. TCHAR m_szColumnName[129];
  351. GUID m_guidColumn;
  352. ULONG m_nColumnPropID;
  353. TCHAR m_szPrivilegeType[20];
  354. VARIANT_BOOL m_bIsGrantable;
  355. // Binding Maps
  356. BEGIN_COLUMN_MAP(CColumnPrivilegeInfo)
  357. COLUMN_ENTRY(1, m_szGrantor)
  358. COLUMN_ENTRY(2, m_szGrantee)
  359. COLUMN_ENTRY(3, m_szTableCatalog)
  360. COLUMN_ENTRY(4, m_szTableSchema)
  361. COLUMN_ENTRY(5, m_szTableName)
  362. COLUMN_ENTRY(6, m_szColumnName)
  363. COLUMN_ENTRY(7, m_guidColumn)
  364. COLUMN_ENTRY(8, m_nColumnPropID)
  365. COLUMN_ENTRY(9, m_szPrivilegeType)
  366. COLUMN_ENTRY(10, m_bIsGrantable)
  367. END_COLUMN_MAP()
  368. };
  369. ///////////////////////////////////////////////////////////////////////////
  370. // class CColumnsInfo
  371. class CColumnsInfo
  372. {
  373. public:
  374. // Constructors and Destructors
  375. CColumnsInfo()
  376. {
  377. memset(this, 0, sizeof(*this));
  378. }
  379. // Operations
  380. TCHAR m_szTableCatalog[129];
  381. TCHAR m_szTableSchema[129];
  382. TCHAR m_szTableName[129];
  383. TCHAR m_szColumnName[129];
  384. GUID m_guidColumn;
  385. ULONG m_nColumnPropID;
  386. ULONG m_nOrdinalPosition;
  387. VARIANT_BOOL m_bColumnHasDefault;
  388. TCHAR m_szColumnDefault[129];
  389. ULONG m_nColumnFlags;
  390. VARIANT_BOOL m_bIsNullable;
  391. USHORT m_nDataType;
  392. GUID m_guidType;
  393. ULONG m_nMaxLength;
  394. ULONG m_nOctetLength;
  395. USHORT m_nNumericPrecision;
  396. SHORT m_nNumericScale;
  397. ULONG m_nDateTimePrecision;
  398. TCHAR m_szCharSetCatalog[129];
  399. TCHAR m_szCharSetSchema[129];
  400. TCHAR m_szCharSetName[129];
  401. TCHAR m_szCollationCatalog[129];
  402. TCHAR m_szCollationSchema[129];
  403. TCHAR m_szCollationName[129];
  404. TCHAR m_szDomainCatalog[129];
  405. TCHAR m_szDomainSchema[129];
  406. TCHAR m_szDomainName[129];
  407. TCHAR m_szDescription[129];
  408. BEGIN_COLUMN_MAP(CColumnsInfo)
  409. COLUMN_ENTRY(1, m_szTableCatalog)
  410. COLUMN_ENTRY(2, m_szTableSchema)
  411. COLUMN_ENTRY(3, m_szTableName)
  412. COLUMN_ENTRY(4, m_szColumnName)
  413. COLUMN_ENTRY(5, m_guidColumn)
  414. COLUMN_ENTRY(6, m_nColumnPropID)
  415. COLUMN_ENTRY(7, m_nOrdinalPosition)
  416. COLUMN_ENTRY(8, m_bColumnHasDefault)
  417. COLUMN_ENTRY(9, m_szColumnDefault)
  418. COLUMN_ENTRY(10, m_nColumnFlags)
  419. COLUMN_ENTRY(11, m_bIsNullable)
  420. COLUMN_ENTRY(12, m_nDataType)
  421. COLUMN_ENTRY(13, m_guidType)
  422. COLUMN_ENTRY(14, m_nMaxLength)
  423. COLUMN_ENTRY(15, m_nOctetLength)
  424. COLUMN_ENTRY(16, m_nNumericPrecision)
  425. COLUMN_ENTRY(17, m_nNumericScale)
  426. COLUMN_ENTRY(18, m_nDateTimePrecision)
  427. COLUMN_ENTRY(19, m_szCharSetCatalog)
  428. COLUMN_ENTRY(20, m_szCharSetSchema)
  429. COLUMN_ENTRY(21, m_szCharSetName)
  430. COLUMN_ENTRY(22, m_szCollationCatalog)
  431. COLUMN_ENTRY(23, m_szCollationSchema)
  432. COLUMN_ENTRY(24, m_szCollationName)
  433. COLUMN_ENTRY(25, m_szDomainCatalog)
  434. COLUMN_ENTRY(26, m_szDomainSchema)
  435. COLUMN_ENTRY(27, m_szDomainName)
  436. COLUMN_ENTRY(28, m_szDescription)
  437. END_COLUMN_MAP()
  438. };
  439. ///////////////////////////////////////////////////////////////////////////
  440. // class CConstraintColumnUsageInfo
  441. class CConstraintColumnUsageInfo
  442. {
  443. public:
  444. // Constructor
  445. CConstraintColumnUsageInfo()
  446. {
  447. memset(this, 0, sizeof(*this));
  448. }
  449. // Attributes
  450. TCHAR m_szTableCatalog[129];
  451. TCHAR m_szTableSchema[129];
  452. TCHAR m_szTableName[129];
  453. TCHAR m_szColumnName[129];
  454. GUID m_guidColumn;
  455. ULONG m_nColumnPropID;
  456. TCHAR m_szConstraintCatalog[129];
  457. TCHAR m_szConstraintSchema[129];
  458. TCHAR m_szConstraintName[129];
  459. // Binding Maps
  460. BEGIN_COLUMN_MAP(CConstraintColumnUsageInfo)
  461. COLUMN_ENTRY(1, m_szTableCatalog)
  462. COLUMN_ENTRY(2, m_szTableSchema)
  463. COLUMN_ENTRY(3, m_szTableName)
  464. COLUMN_ENTRY(4, m_szColumnName)
  465. COLUMN_ENTRY(5, m_guidColumn)
  466. COLUMN_ENTRY(6, m_nColumnPropID)
  467. COLUMN_ENTRY(7, m_szConstraintCatalog)
  468. COLUMN_ENTRY(8, m_szConstraintSchema)
  469. COLUMN_ENTRY(9, m_szConstraintName)
  470. END_COLUMN_MAP()
  471. };
  472. ///////////////////////////////////////////////////////////////////////////
  473. // class CConstraintColumnUsageInfo
  474. class CConstraintTableUsageInfo
  475. {
  476. public:
  477. // Constructor
  478. CConstraintTableUsageInfo()
  479. {
  480. memset(this, 0, sizeof(*this));
  481. }
  482. // Attributes
  483. TCHAR m_szTableCatalog[129];
  484. TCHAR m_szTableSchema[129];
  485. TCHAR m_szTableName[129];
  486. TCHAR m_szConstraintCatalog[129];
  487. TCHAR m_szConstraintSchema[129];
  488. TCHAR m_szConstraintName[129];
  489. // Binding Maps
  490. BEGIN_COLUMN_MAP(CConstraintTableUsageInfo)
  491. COLUMN_ENTRY(1, m_szTableCatalog)
  492. COLUMN_ENTRY(2, m_szTableSchema)
  493. COLUMN_ENTRY(3, m_szTableName)
  494. COLUMN_ENTRY(4, m_szConstraintCatalog)
  495. COLUMN_ENTRY(5, m_szConstraintSchema)
  496. COLUMN_ENTRY(6, m_szConstraintName)
  497. END_COLUMN_MAP()
  498. };
  499. ///////////////////////////////////////////////////////////////////////////
  500. // class CForeignKeysInfo
  501. class CForeignKeysInfo
  502. {
  503. public:
  504. // Constructor
  505. CForeignKeysInfo()
  506. {
  507. memset(this, 0, sizeof(*this));
  508. }
  509. // Attributes
  510. TCHAR m_szPKTableCatalog[129];
  511. TCHAR m_szPKTableSchema[129];
  512. TCHAR m_szPKTableName[129];
  513. TCHAR m_szPKColumnName[129];
  514. GUID m_guidPKColumn;
  515. ULONG m_nPKColumnPropID;
  516. TCHAR m_szFKTableCatalog[129];
  517. TCHAR m_szFKTableSchema[129];
  518. TCHAR m_szFKTableName[129];
  519. TCHAR m_szFKColumnName[129];
  520. GUID m_guidFKColumn;
  521. ULONG m_nFKColumnPropID;
  522. ULONG m_nOrdinal;
  523. TCHAR m_szUpdateRule[12];
  524. TCHAR m_szDeleteRule[12];
  525. // Binding Info
  526. BEGIN_COLUMN_MAP(CForeignKeysInfo)
  527. COLUMN_ENTRY(1, m_szPKTableCatalog)
  528. COLUMN_ENTRY(2, m_szPKTableSchema)
  529. COLUMN_ENTRY(3, m_szPKTableName)
  530. COLUMN_ENTRY(4, m_szPKColumnName)
  531. COLUMN_ENTRY(5, m_guidPKColumn)
  532. COLUMN_ENTRY(6, m_nPKColumnPropID)
  533. COLUMN_ENTRY(7, m_szFKTableCatalog)
  534. COLUMN_ENTRY(8, m_szFKTableSchema)
  535. COLUMN_ENTRY(9, m_szFKTableName)
  536. COLUMN_ENTRY(10, m_szFKColumnName)
  537. COLUMN_ENTRY(11, m_guidFKColumn)
  538. COLUMN_ENTRY(12, m_nFKColumnPropID)
  539. COLUMN_ENTRY(13, m_nOrdinal)
  540. COLUMN_ENTRY(14, m_szUpdateRule)
  541. COLUMN_ENTRY(15, m_szDeleteRule)
  542. END_COLUMN_MAP()
  543. };
  544. ///////////////////////////////////////////////////////////////////////////
  545. // class CIndexesInfo
  546. class CIndexesInfo
  547. {
  548. public:
  549. // Constructors
  550. CIndexesInfo()
  551. {
  552. memset(this, 0, sizeof(*this));
  553. }
  554. // Attributes
  555. TCHAR m_szTableCatalog[129];
  556. TCHAR m_szTableSchema[129];
  557. TCHAR m_szTableName[129];
  558. TCHAR m_szIndexCatalog[129];
  559. TCHAR m_szIndexSchema[129];
  560. TCHAR m_szIndexName[129];
  561. VARIANT_BOOL m_bPrimaryKey;
  562. VARIANT_BOOL m_bUnique;
  563. VARIANT_BOOL m_bClustered;
  564. USHORT m_nType;
  565. LONG m_nFillFactor;
  566. LONG m_nInitialSize;
  567. LONG m_nNulls;
  568. VARIANT_BOOL m_bSortBookmarks;
  569. VARIANT_BOOL m_bAutoUpdate;
  570. LONG m_nNullCollation;
  571. ULONG m_nOrdinalPosition;
  572. TCHAR m_szColumnName[129];
  573. GUID m_guidColumn;
  574. ULONG m_nColumnPropID;
  575. SHORT m_nCollation;
  576. LONG m_nCardinality;
  577. LONG m_nPages;
  578. TCHAR m_szFilterCondition[129];
  579. // Binding Maps
  580. BEGIN_COLUMN_MAP(CIndexesInfo)
  581. COLUMN_ENTRY(1, m_szTableCatalog)
  582. COLUMN_ENTRY(2, m_szTableSchema)
  583. COLUMN_ENTRY(3, m_szTableName)
  584. COLUMN_ENTRY(4, m_szIndexCatalog)
  585. COLUMN_ENTRY(5, m_szIndexSchema)
  586. COLUMN_ENTRY(6, m_szIndexName)
  587. COLUMN_ENTRY(7, m_bPrimaryKey)
  588. COLUMN_ENTRY(8, m_bUnique)
  589. COLUMN_ENTRY(9, m_bClustered)
  590. COLUMN_ENTRY(10, m_nType)
  591. COLUMN_ENTRY(11, m_nFillFactor)
  592. COLUMN_ENTRY(12, m_nInitialSize)
  593. COLUMN_ENTRY(13, m_nNulls)
  594. COLUMN_ENTRY(14, m_bSortBookmarks)
  595. COLUMN_ENTRY(15, m_bAutoUpdate)
  596. COLUMN_ENTRY(16, m_nNullCollation)
  597. COLUMN_ENTRY(17, m_nOrdinalPosition)
  598. COLUMN_ENTRY(18, m_szColumnName)
  599. COLUMN_ENTRY(19, m_guidColumn)
  600. COLUMN_ENTRY(20, m_nColumnPropID)
  601. COLUMN_ENTRY(21, m_nCollation)
  602. COLUMN_ENTRY(22, m_nCardinality)
  603. COLUMN_ENTRY(23, m_nPages)
  604. COLUMN_ENTRY(25, m_szFilterCondition)
  605. END_COLUMN_MAP()
  606. };
  607. ///////////////////////////////////////////////////////////////////////////
  608. // class CKeyColumnUsageInfo
  609. class CKeyColumnUsageInfo
  610. {
  611. public:
  612. // Constructors
  613. CKeyColumnUsageInfo()
  614. {
  615. memset(this, 0, sizeof(*this));
  616. }
  617. // Attributes
  618. TCHAR m_szConstraintCatalog[129];
  619. TCHAR m_szConstraintSchema[129];
  620. TCHAR m_szConstraintName[129];
  621. TCHAR m_szTableCatalog[129];
  622. TCHAR m_szTableSchema[129];
  623. TCHAR m_szTableName[129];
  624. TCHAR m_szColumnName[129];
  625. GUID m_guidColumn;
  626. ULONG m_nColumnPropID;
  627. ULONG m_nOrdinalPosition;
  628. // Binding Maps
  629. BEGIN_COLUMN_MAP(CKeyColumnUsageInfo)
  630. COLUMN_ENTRY(1, m_szConstraintCatalog)
  631. COLUMN_ENTRY(2, m_szConstraintSchema)
  632. COLUMN_ENTRY(3, m_szConstraintName)
  633. COLUMN_ENTRY(4, m_szTableCatalog)
  634. COLUMN_ENTRY(5, m_szTableSchema)
  635. COLUMN_ENTRY(6, m_szTableName)
  636. COLUMN_ENTRY(7, m_szColumnName)
  637. COLUMN_ENTRY(8, m_guidColumn)
  638. COLUMN_ENTRY(9, m_nColumnPropID)
  639. COLUMN_ENTRY(10, m_nOrdinalPosition)
  640. END_COLUMN_MAP()
  641. };
  642. ///////////////////////////////////////////////////////////////////////////
  643. // class CPrimaryKeyInfo
  644. class CPrimaryKeyInfo
  645. {
  646. public:
  647. // Constructors
  648. CPrimaryKeyInfo()
  649. {
  650. memset(this, 0, sizeof(*this));
  651. }
  652. // Attributes
  653. TCHAR m_szTableCatalog[129];
  654. TCHAR m_szTableSchema[129];
  655. TCHAR m_szTableName[129];
  656. TCHAR m_szColumnName[129];
  657. GUID m_guidColumn;
  658. ULONG m_nColumnPropID;
  659. ULONG m_nOrdinal;
  660. // Binding Maps
  661. BEGIN_COLUMN_MAP(CPrimaryKeyInfo)
  662. COLUMN_ENTRY(1, m_szTableCatalog)
  663. COLUMN_ENTRY(2, m_szTableSchema)
  664. COLUMN_ENTRY(3, m_szTableName)
  665. COLUMN_ENTRY(4, m_szColumnName)
  666. COLUMN_ENTRY(5, m_guidColumn)
  667. COLUMN_ENTRY(6, m_nColumnPropID)
  668. COLUMN_ENTRY(7, m_nOrdinal)
  669. END_COLUMN_MAP()
  670. };
  671. ///////////////////////////////////////////////////////////////////////////
  672. // class CProcedureColumnInfo
  673. class CProcedureColumnInfo
  674. {
  675. public:
  676. // Constructors
  677. CProcedureColumnInfo()
  678. {
  679. memset(this, 0, sizeof(*this));
  680. }
  681. // Attributes
  682. TCHAR m_szCatalog[129];
  683. TCHAR m_szSchema[129];
  684. TCHAR m_szName[129];
  685. TCHAR m_szColumnName[129];
  686. GUID m_guidColumn;
  687. ULONG m_nColumnPropID;
  688. ULONG m_nRowsetNumber;
  689. ULONG m_nOrdinalPosition;
  690. VARIANT_BOOL m_bIsNullable;
  691. USHORT m_nDataType;
  692. GUID m_guidType;
  693. ULONG m_nMaxLength;
  694. ULONG m_nOctetLength;
  695. USHORT m_nPrecision;
  696. SHORT m_nScale;
  697. TCHAR m_szDescription[129];
  698. // Binding Maps
  699. BEGIN_COLUMN_MAP(CProcedureColumnInfo)
  700. COLUMN_ENTRY(1, m_szCatalog)
  701. COLUMN_ENTRY(2, m_szSchema)
  702. COLUMN_ENTRY(3, m_szName)
  703. COLUMN_ENTRY(4, m_szColumnName)
  704. COLUMN_ENTRY(5, m_guidColumn)
  705. COLUMN_ENTRY(6, m_nColumnPropID)
  706. COLUMN_ENTRY(7, m_nRowsetNumber)
  707. COLUMN_ENTRY(8, m_nOrdinalPosition)
  708. COLUMN_ENTRY(9, m_bIsNullable)
  709. COLUMN_ENTRY(10, m_nDataType)
  710. COLUMN_ENTRY(11, m_guidType)
  711. COLUMN_ENTRY(12, m_nMaxLength)
  712. COLUMN_ENTRY(13, m_nOctetLength)
  713. COLUMN_ENTRY(14, m_nPrecision)
  714. COLUMN_ENTRY(15, m_nScale)
  715. COLUMN_ENTRY(16, m_szDescription)
  716. END_COLUMN_MAP()
  717. };
  718. ///////////////////////////////////////////////////////////////////////////
  719. // class CProcedureParameterInfo
  720. class CProcedureParameterInfo
  721. {
  722. public:
  723. // Constructors
  724. CProcedureParameterInfo()
  725. {
  726. memset(this, 0, sizeof(*this));
  727. }
  728. // Attributes
  729. TCHAR m_szCatalog[129];
  730. TCHAR m_szSchema[129];
  731. TCHAR m_szName[129];
  732. TCHAR m_szParameterName[129];
  733. USHORT m_nOrdinalPosition;
  734. USHORT m_nType;
  735. VARIANT_BOOL m_bHasDefault;
  736. TCHAR m_szDefault[129];
  737. VARIANT_BOOL m_bIsNullable;
  738. USHORT m_nDataType;
  739. ULONG m_nMaxLength;
  740. ULONG m_nOctetLength;
  741. USHORT m_nPrecision;
  742. SHORT m_nScale;
  743. TCHAR m_szDescription[129];
  744. // Binding Maps
  745. BEGIN_COLUMN_MAP(CProcedureParameterInfo)
  746. COLUMN_ENTRY(1, m_szCatalog)
  747. COLUMN_ENTRY(2, m_szSchema)
  748. COLUMN_ENTRY(3, m_szName)
  749. COLUMN_ENTRY(4, m_szParameterName)
  750. COLUMN_ENTRY(5, m_nOrdinalPosition)
  751. COLUMN_ENTRY(6, m_nType)
  752. COLUMN_ENTRY(7, m_bHasDefault)
  753. COLUMN_ENTRY(8, m_szDefault)
  754. COLUMN_ENTRY(9, m_bIsNullable)
  755. COLUMN_ENTRY(10, m_nDataType)
  756. COLUMN_ENTRY(11, m_nMaxLength)
  757. COLUMN_ENTRY(12, m_nOctetLength)
  758. COLUMN_ENTRY(13, m_nPrecision)
  759. COLUMN_ENTRY(14, m_nScale)
  760. COLUMN_ENTRY(15, m_szDescription)
  761. END_COLUMN_MAP()
  762. };
  763. ///////////////////////////////////////////////////////////////////////////
  764. // class CProcedureInfo
  765. class CProcedureInfo
  766. {
  767. public:
  768. // Constructors
  769. CProcedureInfo()
  770. {
  771. memset(this, 0, sizeof(*this));
  772. }
  773. // Attributes
  774. TCHAR m_szCatalog[129];
  775. TCHAR m_szSchema[129];
  776. TCHAR m_szName[129];
  777. SHORT m_nType;
  778. TCHAR m_szDefinition[129];
  779. TCHAR m_szDescription[129];
  780. // Binding Maps
  781. BEGIN_COLUMN_MAP(CProcedureInfo)
  782. COLUMN_ENTRY(1, m_szCatalog)
  783. COLUMN_ENTRY(2, m_szSchema)
  784. COLUMN_ENTRY(3, m_szName)
  785. COLUMN_ENTRY(4, m_nType)
  786. COLUMN_ENTRY(5, m_szDefinition)
  787. COLUMN_ENTRY(6, m_szDescription)
  788. END_COLUMN_MAP()
  789. };
  790. ///////////////////////////////////////////////////////////////////////////
  791. // class CProviderTypeInfo
  792. class CProviderTypeInfo
  793. {
  794. public:
  795. // Constructors
  796. CProviderTypeInfo()
  797. {
  798. memset(this, 0, sizeof(*this));
  799. }
  800. // Attributes
  801. TCHAR m_szTypeName[129];
  802. USHORT m_nDataType;
  803. ULONG m_nColumnSize;
  804. TCHAR m_szLiteralPrefix[129];
  805. TCHAR m_szLiteralSuffix[129];
  806. TCHAR m_szCreateParams[129];
  807. VARIANT_BOOL m_bIsNullable;
  808. VARIANT_BOOL m_bCaseSensitive;
  809. ULONG m_nSearchable;
  810. VARIANT_BOOL m_bUnsignedAttribute;
  811. VARIANT_BOOL m_bFixedPrecScale;
  812. VARIANT_BOOL m_bAutoUniqueValue;
  813. TCHAR m_szLocalTypeName[129];
  814. SHORT m_nMinScale;
  815. SHORT m_nMaxScale;
  816. GUID m_guidType;
  817. TCHAR m_szTypeLib[129];
  818. TCHAR m_szVersion[129];
  819. VARIANT_BOOL m_bIsLong;
  820. VARIANT_BOOL m_bBestMatch;
  821. // Binding Maps
  822. BEGIN_COLUMN_MAP(CProviderTypeInfo)
  823. COLUMN_ENTRY(1, m_szTypeName)
  824. COLUMN_ENTRY(2, m_nDataType)
  825. COLUMN_ENTRY(3, m_nColumnSize)
  826. COLUMN_ENTRY(4, m_szLiteralPrefix)
  827. COLUMN_ENTRY(5, m_szLiteralSuffix)
  828. COLUMN_ENTRY(6, m_szCreateParams)
  829. COLUMN_ENTRY(7, m_bIsNullable)
  830. COLUMN_ENTRY(8, m_bCaseSensitive)
  831. COLUMN_ENTRY(9, m_nSearchable)
  832. COLUMN_ENTRY(10, m_bUnsignedAttribute)
  833. COLUMN_ENTRY(11, m_bFixedPrecScale)
  834. COLUMN_ENTRY(12, m_bAutoUniqueValue)
  835. COLUMN_ENTRY(13, m_szLocalTypeName)
  836. COLUMN_ENTRY(14, m_nMinScale)
  837. COLUMN_ENTRY(15, m_nMaxScale)
  838. COLUMN_ENTRY(16, m_guidType)
  839. COLUMN_ENTRY(17, m_szTypeLib)
  840. COLUMN_ENTRY(18, m_szVersion)
  841. COLUMN_ENTRY(19, m_bIsLong)
  842. COLUMN_ENTRY(20, m_bBestMatch)
  843. END_COLUMN_MAP()
  844. };
  845. ///////////////////////////////////////////////////////////////////////////
  846. // class CReferentialConstraintInfo
  847. class CReferentialConstraintInfo
  848. {
  849. public:
  850. // Constructors
  851. CReferentialConstraintInfo()
  852. {
  853. memset(this, 0, sizeof(*this));
  854. }
  855. // Attributes
  856. TCHAR m_szCatalog[129];
  857. TCHAR m_szSchema[129];
  858. TCHAR m_szName[129];
  859. TCHAR m_szUniqueCatalog[129];
  860. TCHAR m_szUniqueSchema[129];
  861. TCHAR m_szUniqueName[129];
  862. TCHAR m_szMatchOption[8];
  863. TCHAR m_szUpdateRule[12];
  864. TCHAR m_szDeleteRule[12];
  865. TCHAR m_szDescription[129];
  866. // Binding Maps
  867. BEGIN_COLUMN_MAP(CReferentialConstraintInfo)
  868. COLUMN_ENTRY(1, m_szCatalog)
  869. COLUMN_ENTRY(2, m_szSchema)
  870. COLUMN_ENTRY(3, m_szName)
  871. COLUMN_ENTRY(4, m_szUniqueCatalog)
  872. COLUMN_ENTRY(5, m_szUniqueSchema)
  873. COLUMN_ENTRY(6, m_szUniqueName)
  874. COLUMN_ENTRY(7, m_szMatchOption)
  875. COLUMN_ENTRY(8, m_szUpdateRule)
  876. COLUMN_ENTRY(9, m_szDeleteRule)
  877. COLUMN_ENTRY(10, m_szDescription)
  878. END_COLUMN_MAP()
  879. };
  880. ///////////////////////////////////////////////////////////////////////////
  881. // class CSchemataInfo
  882. class CSchemataInfo
  883. {
  884. public:
  885. // Constructors
  886. CSchemataInfo()
  887. {
  888. memset(this, 0, sizeof(*this));
  889. }
  890. // Attributes
  891. TCHAR m_szCatalog[129];
  892. TCHAR m_szName[129];
  893. TCHAR m_szOwner[129];
  894. TCHAR m_szCharCatalog[129];
  895. TCHAR m_szCharSchema[129];
  896. TCHAR m_szCharName[129];
  897. // Binding Maps
  898. BEGIN_COLUMN_MAP(CSchemataInfo)
  899. COLUMN_ENTRY(1, m_szCatalog)
  900. COLUMN_ENTRY(2, m_szName)
  901. COLUMN_ENTRY(3, m_szOwner)
  902. COLUMN_ENTRY(4, m_szCharCatalog)
  903. COLUMN_ENTRY(5, m_szCharSchema)
  904. COLUMN_ENTRY(6, m_szCharName)
  905. END_COLUMN_MAP()
  906. };
  907. ///////////////////////////////////////////////////////////////////////////
  908. // class CSQLLangugageInfo
  909. class CSQLLanguageInfo
  910. {
  911. public:
  912. // Constructors
  913. CSQLLanguageInfo()
  914. {
  915. memset(this, 0, sizeof(*this));
  916. }
  917. // Attributes
  918. TCHAR m_szSource[10];
  919. TCHAR m_szYear[5];
  920. TCHAR m_szConformance[13];
  921. TCHAR m_szIntegrity[4];
  922. TCHAR m_szImplementation[24];
  923. TCHAR m_szBindingStyle[10];
  924. TCHAR m_szProgrammingLanguage[10];
  925. // Binding Maps
  926. BEGIN_COLUMN_MAP(CSQLLanguageInfo)
  927. COLUMN_ENTRY(1, m_szSource)
  928. COLUMN_ENTRY(2, m_szYear)
  929. COLUMN_ENTRY(3, m_szConformance)
  930. COLUMN_ENTRY(4, m_szIntegrity)
  931. COLUMN_ENTRY(5, m_szImplementation)
  932. COLUMN_ENTRY(6, m_szBindingStyle)
  933. COLUMN_ENTRY(7, m_szProgrammingLanguage)
  934. END_COLUMN_MAP()
  935. };
  936. ///////////////////////////////////////////////////////////////////////////
  937. // class CStatisticInfo
  938. class CStatisticInfo
  939. {
  940. public:
  941. // Constructors
  942. CStatisticInfo()
  943. {
  944. memset(this, 0, sizeof(*this));
  945. }
  946. // Attributes
  947. TCHAR m_szTableCatalog[129];
  948. TCHAR m_szTableSchema[129];
  949. TCHAR m_szTableName[129];
  950. LONG m_nCardinality;
  951. // Binding Maps
  952. BEGIN_COLUMN_MAP(CStatisticInfo)
  953. COLUMN_ENTRY(1, m_szTableCatalog)
  954. COLUMN_ENTRY(2, m_szTableSchema)
  955. COLUMN_ENTRY(3, m_szTableName)
  956. COLUMN_ENTRY(4, m_nCardinality)
  957. END_COLUMN_MAP()
  958. };
  959. ///////////////////////////////////////////////////////////////////////////
  960. // class CTableConstraintInfo
  961. class CTableConstraintInfo
  962. {
  963. public:
  964. // Constructors
  965. CTableConstraintInfo()
  966. {
  967. memset(this, 0, sizeof(*this));
  968. }
  969. // Attributes
  970. TCHAR m_szCatalog[129];
  971. TCHAR m_szSchema[129];
  972. TCHAR m_szName[129];
  973. TCHAR m_szTableCatalog[129];
  974. TCHAR m_szTableSchema[129];
  975. TCHAR m_szTableName[129];
  976. TCHAR m_szType[12];
  977. VARIANT_BOOL m_bIsDeferrable;
  978. VARIANT_BOOL m_bInitiallyDeferred;
  979. TCHAR m_szDescription[129];
  980. // Binding Maps
  981. BEGIN_COLUMN_MAP(CTableConstraintInfo)
  982. COLUMN_ENTRY(1, m_szCatalog)
  983. COLUMN_ENTRY(2, m_szSchema)
  984. COLUMN_ENTRY(3, m_szName)
  985. COLUMN_ENTRY(4, m_szTableCatalog)
  986. COLUMN_ENTRY(5, m_szTableSchema)
  987. COLUMN_ENTRY(6, m_szTableName)
  988. COLUMN_ENTRY(7, m_szType)
  989. COLUMN_ENTRY(8, m_bIsDeferrable)
  990. COLUMN_ENTRY(9, m_bInitiallyDeferred)
  991. COLUMN_ENTRY(10, m_szDescription)
  992. END_COLUMN_MAP()
  993. };
  994. ///////////////////////////////////////////////////////////////////////////
  995. // class CTablePrivilegeInfo
  996. class CTablePrivilegeInfo
  997. {
  998. public:
  999. // Constructors
  1000. CTablePrivilegeInfo()
  1001. {
  1002. memset(this, 0, sizeof(*this));
  1003. }
  1004. // Attributes
  1005. TCHAR m_szGrantor[129];
  1006. TCHAR m_szGrantee[129];
  1007. TCHAR m_szCatalog[129];
  1008. TCHAR m_szSchema[129];
  1009. TCHAR m_szName[129];
  1010. TCHAR m_szType[12];
  1011. VARIANT_BOOL m_bIsGrantable;
  1012. // Binding Maps
  1013. BEGIN_COLUMN_MAP(CTablePrivilegeInfo)
  1014. COLUMN_ENTRY(1, m_szGrantor)
  1015. COLUMN_ENTRY(2, m_szGrantee)
  1016. COLUMN_ENTRY(3, m_szCatalog)
  1017. COLUMN_ENTRY(4, m_szSchema)
  1018. COLUMN_ENTRY(5, m_szName)
  1019. COLUMN_ENTRY(6, m_szType)
  1020. COLUMN_ENTRY(7, m_bIsGrantable)
  1021. END_COLUMN_MAP()
  1022. };
  1023. ///////////////////////////////////////////////////////////////////////////
  1024. // class CTableInfo
  1025. class CTableInfo
  1026. {
  1027. public:
  1028. // Constructors
  1029. CTableInfo()
  1030. {
  1031. memset(this, 0, sizeof(*this));
  1032. }
  1033. // Attributes
  1034. TCHAR m_szCatalog[129];
  1035. TCHAR m_szSchema[129];
  1036. TCHAR m_szName[129];
  1037. TCHAR m_szType[129];
  1038. GUID m_guidTable;
  1039. TCHAR m_szDescription[129];
  1040. // Binding Map
  1041. BEGIN_COLUMN_MAP(CTableInfo)
  1042. COLUMN_ENTRY(1, m_szCatalog)
  1043. COLUMN_ENTRY(2, m_szSchema)
  1044. COLUMN_ENTRY(3, m_szName)
  1045. COLUMN_ENTRY(4, m_szType)
  1046. COLUMN_ENTRY(5, m_guidTable)
  1047. COLUMN_ENTRY(6, m_szDescription)
  1048. END_COLUMN_MAP()
  1049. };
  1050. ///////////////////////////////////////////////////////////////////////////
  1051. // class CTranslationInfo
  1052. class CTranslationInfo
  1053. {
  1054. public:
  1055. // Constructors
  1056. CTranslationInfo()
  1057. {
  1058. memset(this, 0, sizeof(*this));
  1059. }
  1060. // Attributes
  1061. TCHAR m_szCatalog[129];
  1062. TCHAR m_szSchema[129];
  1063. TCHAR m_szName[129];
  1064. TCHAR m_szSourceCatalog[129];
  1065. TCHAR m_szSourceSchema[129];
  1066. TCHAR m_szSourceName[129];
  1067. TCHAR m_szTargetCatalog[129];
  1068. TCHAR m_szTargetSchema[129];
  1069. TCHAR m_szTargetName[129];
  1070. // Binding Maps
  1071. BEGIN_COLUMN_MAP(CTranslationInfo)
  1072. COLUMN_ENTRY(1, m_szCatalog)
  1073. COLUMN_ENTRY(2, m_szSchema)
  1074. COLUMN_ENTRY(3, m_szName)
  1075. COLUMN_ENTRY(4, m_szSourceCatalog)
  1076. COLUMN_ENTRY(5, m_szSourceSchema)
  1077. COLUMN_ENTRY(6, m_szSourceName)
  1078. COLUMN_ENTRY(7, m_szTargetCatalog)
  1079. COLUMN_ENTRY(8, m_szTargetSchema)
  1080. COLUMN_ENTRY(9, m_szTargetName)
  1081. END_COLUMN_MAP()
  1082. };
  1083. ///////////////////////////////////////////////////////////////////////////
  1084. // class CUsagePrivilegeInfo
  1085. class CUsagePrivilegeInfo
  1086. {
  1087. public:
  1088. // Constructors
  1089. CUsagePrivilegeInfo()
  1090. {
  1091. memset(this, 0, sizeof(*this));
  1092. }
  1093. // Attributes
  1094. TCHAR m_szGrantor[129];
  1095. TCHAR m_szGrantee[129];
  1096. TCHAR m_szObjectCatalog[129];
  1097. TCHAR m_szObjectSchema[129];
  1098. TCHAR m_szObjectName[129];
  1099. TCHAR m_szObjectType[12];
  1100. TCHAR m_szPrivilegeType[6];
  1101. VARIANT_BOOL m_bIsGrantable;
  1102. // Binding Maps
  1103. BEGIN_COLUMN_MAP(CUsagePrivilegeInfo)
  1104. COLUMN_ENTRY(1, m_szGrantor)
  1105. COLUMN_ENTRY(2, m_szGrantee)
  1106. COLUMN_ENTRY(3, m_szObjectCatalog)
  1107. COLUMN_ENTRY(4, m_szObjectSchema)
  1108. COLUMN_ENTRY(5, m_szObjectName)
  1109. COLUMN_ENTRY(6, m_szObjectType)
  1110. COLUMN_ENTRY(7, m_szPrivilegeType)
  1111. COLUMN_ENTRY(8, m_bIsGrantable)
  1112. END_COLUMN_MAP()
  1113. };
  1114. ///////////////////////////////////////////////////////////////////////////
  1115. // class CViewColumnUsageInfo
  1116. class CViewColumnUsageInfo
  1117. {
  1118. public:
  1119. // Constructors
  1120. CViewColumnUsageInfo()
  1121. {
  1122. memset(this, 0, sizeof(*this));
  1123. }
  1124. // Attributes
  1125. TCHAR m_szCatalog[129];
  1126. TCHAR m_szSchema[129];
  1127. TCHAR m_szName[129];
  1128. TCHAR m_szTableCatalog[129];
  1129. TCHAR m_szTableSchema[129];
  1130. TCHAR m_szTableName[129];
  1131. TCHAR m_szColumnName[129];
  1132. GUID m_guidColumn;
  1133. ULONG m_nColumnPropID;
  1134. // Binding Maps
  1135. BEGIN_COLUMN_MAP(CViewColumnUsageInfo)
  1136. COLUMN_ENTRY(1, m_szCatalog)
  1137. COLUMN_ENTRY(2, m_szSchema)
  1138. COLUMN_ENTRY(3, m_szName)
  1139. COLUMN_ENTRY(4, m_szTableCatalog)
  1140. COLUMN_ENTRY(5, m_szTableSchema)
  1141. COLUMN_ENTRY(6, m_szTableName)
  1142. COLUMN_ENTRY(7, m_szColumnName)
  1143. COLUMN_ENTRY(8, m_guidColumn)
  1144. COLUMN_ENTRY(9, m_nColumnPropID)
  1145. END_COLUMN_MAP()
  1146. };
  1147. ///////////////////////////////////////////////////////////////////////////
  1148. // class CViewTableUsageInfo
  1149. class CViewTableUsageInfo
  1150. {
  1151. public:
  1152. // Constructors
  1153. CViewTableUsageInfo()
  1154. {
  1155. memset(this, 0, sizeof(*this));
  1156. }
  1157. // Attributes
  1158. TCHAR m_szCatalog[129];
  1159. TCHAR m_szSchema[129];
  1160. TCHAR m_szName[129];
  1161. TCHAR m_szTableCatalog[129];
  1162. TCHAR m_szTableSchema[129];
  1163. TCHAR m_szTableName[129];
  1164. // Binding Maps
  1165. BEGIN_COLUMN_MAP(CViewTableUsageInfo)
  1166. COLUMN_ENTRY(1, m_szCatalog)
  1167. COLUMN_ENTRY(2, m_szSchema)
  1168. COLUMN_ENTRY(3, m_szName)
  1169. COLUMN_ENTRY(4, m_szTableCatalog)
  1170. COLUMN_ENTRY(5, m_szTableSchema)
  1171. COLUMN_ENTRY(6, m_szTableName)
  1172. END_COLUMN_MAP()
  1173. };
  1174. ///////////////////////////////////////////////////////////////////////////
  1175. // class CViewInfo
  1176. class CViewInfo
  1177. {
  1178. public:
  1179. // Constructors
  1180. CViewInfo()
  1181. {
  1182. memset(this, 0, sizeof(*this));
  1183. }
  1184. // Attributes
  1185. TCHAR m_szTableCatalog[129];
  1186. TCHAR m_szTableSchema[129];
  1187. TCHAR m_szTableName[129];
  1188. TCHAR m_szDefinition[129];
  1189. VARIANT_BOOL m_bCheckOption;
  1190. VARIANT_BOOL m_bIsUpdatable;
  1191. TCHAR m_szDescription[129];
  1192. // Binding Maps
  1193. BEGIN_COLUMN_MAP(CViewInfo)
  1194. COLUMN_ENTRY(1, m_szTableCatalog)
  1195. COLUMN_ENTRY(2, m_szTableSchema)
  1196. COLUMN_ENTRY(3, m_szTableName)
  1197. COLUMN_ENTRY(4, m_szDefinition)
  1198. COLUMN_ENTRY(5, m_bCheckOption)
  1199. COLUMN_ENTRY(6, m_bIsUpdatable)
  1200. COLUMN_ENTRY(7, m_szDescription)
  1201. END_COLUMN_MAP()
  1202. };
  1203. ///////////////////////////////////////////////////////////////////////////
  1204. // typedefs
  1205. typedef CRestrictions<CAccessor<CAssertionInfo>, 3, &DBSCHEMA_ASSERTIONS> CAssertions;
  1206. typedef CRestrictions<CAccessor<CCatalogInfo>, 1, &DBSCHEMA_CATALOGS > CCatalogs;
  1207. typedef CRestrictions<CAccessor<CCharacterSetInfo>, 3, &DBSCHEMA_CHARACTER_SETS> CCharacterSets;
  1208. typedef CRestrictions<CAccessor<CCheckConstraintInfo>, 3, &DBSCHEMA_CHECK_CONSTRAINTS> CCheckConstraints;
  1209. typedef CRestrictions<CAccessor<CCollationInfo>, 3, &DBSCHEMA_COLLATIONS> CCollations;
  1210. typedef CRestrictions<CAccessor<CColumnDomainUsageInfo>, 4, &DBSCHEMA_COLUMN_DOMAIN_USAGE> CColumnDomainUsage;
  1211. typedef CRestrictions<CAccessor<CColumnPrivilegeInfo>, 6, &DBSCHEMA_COLUMN_PRIVILEGES> CColumnPrivileges;
  1212. typedef CRestrictions<CAccessor<CColumnsInfo>, 4, &DBSCHEMA_COLUMNS> CColumns;
  1213. typedef CRestrictions<CAccessor<CConstraintColumnUsageInfo>,4, &DBSCHEMA_CONSTRAINT_COLUMN_USAGE> CConstraintColumnUsage;
  1214. typedef CRestrictions<CAccessor<CConstraintTableUsageInfo>, 3, &DBSCHEMA_CONSTRAINT_TABLE_USAGE> CConstraintTableUsage;
  1215. typedef CRestrictions<CAccessor<CForeignKeysInfo>, 6, &DBSCHEMA_FOREIGN_KEYS> CForeignKeys;
  1216. typedef CRestrictions<CAccessor<CIndexesInfo>, 5, &DBSCHEMA_INDEXES> CIndexes;
  1217. typedef CRestrictions<CAccessor<CKeyColumnUsageInfo>, 7, &DBSCHEMA_KEY_COLUMN_USAGE> CKeyColumnUsage;
  1218. typedef CRestrictions<CAccessor<CPrimaryKeyInfo>, 3, &DBSCHEMA_PRIMARY_KEYS> CPrimaryKeys;
  1219. typedef CRestrictions<CAccessor<CProcedureColumnInfo>, 4, &DBSCHEMA_PROCEDURE_COLUMNS> CProcedureColumns;
  1220. typedef CRestrictions<CAccessor<CProcedureParameterInfo>, 4, &DBSCHEMA_PROCEDURE_PARAMETERS> CProcedureParameters;
  1221. typedef CRestrictions<CAccessor<CProcedureInfo>, 4, &DBSCHEMA_PROCEDURES> CProcedures;
  1222. typedef CRestrictions<CAccessor<CProviderTypeInfo>, 2, &DBSCHEMA_PROVIDER_TYPES> CProviderTypes;
  1223. typedef CRestrictions<CAccessor<CReferentialConstraintInfo>,3, &DBSCHEMA_REFERENTIAL_CONSTRAINTS> CReferentialConstraints;
  1224. typedef CRestrictions<CAccessor<CSchemataInfo>, 3, &DBSCHEMA_SCHEMATA> CSchemata;
  1225. typedef CRestrictions<CAccessor<CSQLLanguageInfo>, 0, &DBSCHEMA_SQL_LANGUAGES> CSQLLanguages;
  1226. typedef CRestrictions<CAccessor<CStatisticInfo>, 3, &DBSCHEMA_STATISTICS> CStatistics ;
  1227. typedef CRestrictions<CAccessor<CTableConstraintInfo>, 7, &DBSCHEMA_TABLE_CONSTRAINTS> CTableConstraints;
  1228. typedef CRestrictions<CAccessor<CTablePrivilegeInfo>, 5, &DBSCHEMA_TABLE_PRIVILEGES> CTablePrivileges;
  1229. typedef CRestrictions<CAccessor<CTableInfo>, 4, &DBSCHEMA_TABLES> CTables;
  1230. typedef CRestrictions<CAccessor<CTranslationInfo>, 3, &DBSCHEMA_TRANSLATIONS> CTranslations;
  1231. typedef CRestrictions<CAccessor<CUsagePrivilegeInfo>, 6, &DBSCHEMA_USAGE_PRIVILEGES> CUsagePrivileges;
  1232. typedef CRestrictions<CAccessor<CViewColumnUsageInfo>, 3, &DBSCHEMA_VIEW_COLUMN_USAGE> CViewColumnUsage;
  1233. typedef CRestrictions<CAccessor<CViewTableUsageInfo>, 3, &DBSCHEMA_VIEW_TABLE_USAGE> CViewTableUsage;
  1234. typedef CRestrictions<CAccessor<CViewInfo>, 3, &DBSCHEMA_VIEWS> CViews;
  1235. ///////////////////////////////////////////////////////////////////////////
  1236. }; //namespace ATL
  1237. #endif // __ATLDBSCH_H__
  1238. ///////////////////////////////////////////////////////////////////////////