home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / dbdao.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  49.5 KB  |  1,206 lines

  1. /************************************************************************
  2. **      D B D A O . H                                                   *
  3. **                                                                      *
  4. *************************************************************************
  5. ** Copyright (C) 1996 - 1999 Microsoft Corporation                            *
  6. **                 All Rights Reserved                                  *
  7. ************************************************************************/
  8. /*
  9.     DBDAO.H
  10.  
  11.     Class definitions for ddao SDK.  
  12.  
  13. This is a part of the Microsoft Data Access Objects SDK library.
  14. See the  DAO SDK help information for detailed information regarding the
  15. Microsoft Data Access Objects SDK product.
  16.  
  17. */
  18.  
  19. #ifndef _DBDAO_H_
  20. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  21. #define _DBDAO_H_
  22.  
  23. // Ignore warning "non dll-interface class 'X' used as base for dll-interface class 'Y'
  24. #pragma warning( disable : 4275 )
  25.  
  26. //DAO must be built with an MFC version >= 4.2 (or you'll get memory problems with CStrings)
  27.  
  28. #if _MFC_VER < 0x0420
  29. #error The DAOSDK 3.5 libraries will not operate correctly if built with MFC older than 4.2
  30. #endif
  31.  
  32. #ifndef DAO35
  33. #define DAO35
  34. #endif
  35.  
  36. #include <dbdaoint.h>
  37. #include <daogetrw.h>
  38. #include <dbdaoid.h>
  39.  
  40. // Decorations
  41. #define CONSTRUCTOR
  42. #define DESTRUCTOR
  43.  
  44. //Disable export
  45. #ifndef DLLEXPORT
  46. #define DLLEXPORT __declspec( dllexport )
  47. #endif
  48.  
  49. //Macro to convert HRESULT to IDA 
  50. #define DBERR(x) SCODE_CODE(GetScode(x))
  51.  
  52. // Include internal DAO definitions
  53. #include <_dbdao.h>
  54.  
  55. //      DAO Recordset::GetRowsEx() binding definitions
  56.  
  57. #define dbBindIndexINT  1
  58. #define dbBindIndexSTR  2
  59.  
  60. #define dbBindI2                DAO_I2                  // long
  61. #define dbBindI4                DAO_I4                  // short
  62. #define dbBindR4                DAO_R4                  // float
  63. #define dbBindR8                DAO_R8                  // double
  64. #define dbBindCY                DAO_CURRENCY            // Currency
  65. #define dbBindDATE              DAO_DATE                // DATE
  66. #define dbBindBOOL              DAO_BOOL                // VARIANT_BOOL
  67. #define dbBindUI1               DAO_CHAR                // unsigned char
  68. #define dbBindVARIANT            DAO_ANYVARIANT            // VARIANT
  69. #define dbBindWCHAR             DAO_WCHAR               // wchar_t[] (inline)
  70.  
  71. #define dbBindBookmark            DAO_BOOKMARK            // bookmark psuedo field
  72. #define dbBindLPSTR                DAO_LPSTR                // \0 string in pvVarBuffer
  73. #define dbBindLPWSTR            DAO_LPWSTR                // wide string in pvVarBuffer
  74. #define dbBindBlob                DAO_BLOB                // 
  75.  
  76. #ifdef _UNICODE
  77. #define dbBindSTRING    dbBindWCHAR     
  78. #define dbBindLPSTRING    dbBindLPWSTR
  79. #else
  80. #define dbBindSTRING    dbBindUI1
  81. #define dbBindLPSTRING    dbBindLPSTR
  82. #endif
  83.  
  84. //      Binding structure (Used with GetRowsEX)
  85.  
  86. typedef struct
  87.     {
  88.     DWORD   dwBindIndexType;
  89.     union
  90.         {
  91.         LONG    i;
  92.         LPCTSTR pstr;
  93.         };
  94.  
  95.     DWORD   dwType;
  96.     DWORD   dwOffset;
  97.     DWORD   cb;
  98.  
  99.     } DAORSETBINDING, *LPDAORSETBINDING;
  100.  
  101.  
  102.  
  103. /*****************************************************************************
  104. * Forwards
  105. */
  106. class COleVariant;
  107. class CdbBookmark;
  108. class CdbException;
  109. class CdbOleObject;
  110. class CdbObject;
  111. class CdbError;
  112. class CdbProperty;
  113. class CdbDBEngine;
  114. class CdbWorkspace;
  115. class CdbDatabase;
  116. class CdbConnection;
  117. class CdbRecordset;
  118. class CdbGetRowsEx;
  119. class CdbQueryDef;
  120. class CdbTableDef;
  121. class CdbField;
  122. class CdbRelation;
  123. class CdbIndex;
  124. class CdbUser;
  125. class CdbGroup;
  126. class CdbDocument;
  127. class CdbContainer;
  128. class CdbParameter;
  129. class CdbCollection;
  130. class CdbErrors;
  131. class CdbProperties;
  132. class CdbWorkspaces;
  133. class CdbDatabases;
  134. class CdbConnections;
  135. class CdbRecordsets;
  136. class CdbQueryDefs;
  137. class CdbTableDefs;
  138. class CdbFields;
  139. class CdbRelations;
  140. class CdbIndexes;
  141. class CdbUsers;
  142. class CdbGroups;
  143. class CdbDocuments;
  144. class CdbContainers;
  145. class CdbParameters;
  146.  
  147.  
  148. /*****************************************************************************
  149. * CdbException
  150. */
  151. class DLLEXPORT CdbException 
  152.     {
  153. public:
  154.     CONSTRUCTOR                     CdbException            (HRESULT hr);
  155.  
  156.     HRESULT                         m_hr;
  157.     };
  158.  
  159.  
  160. /*****************************************************************************
  161. * CdbBookmark
  162. */
  163. class DLLEXPORT CdbBookmark : public COleVariant
  164.     {
  165.     public:
  166.  
  167.     CONSTRUCTOR                     CdbBookmark                     (LPSAFEARRAY psa);
  168.     CONSTRUCTOR                     CdbBookmark                     ();
  169.     CONSTRUCTOR                     CdbBookmark                     (const CdbBookmark &);
  170.     CdbBookmark &                   operator =                      (const CdbBookmark &);
  171.     operator                        LPSAFEARRAY                     (VOID);
  172.     };
  173.  
  174.  
  175. /*****************************************************************************
  176. * CdbIndexFields (special case for index fields)
  177. */
  178. class DLLEXPORT CdbIndexFields : public CdbFields
  179.     {
  180.     public:
  181.     CdbField                                Item                            (LPCTSTR pstr);
  182.     CdbField                                Item                            (LONG i);
  183.     CdbObject                               ObItem                          (LPCTSTR pstr);
  184.     CdbObject                               ObItem                          (LONG i);
  185.     };
  186.  
  187.  
  188. /*****************************************************************************
  189. * CdbLastOLEError
  190. */
  191. class DLLEXPORT CdbLastOLEError : public CdbOleObject
  192.     {
  193.     public:
  194.  
  195.     CONSTRUCTOR                             CdbLastOLEError         (VOID);
  196.  
  197.     CString                                 GetSource                       (VOID);
  198.     CString                                 GetDescription          (VOID);
  199.     CString                                 GetHelpFile                     (VOID);
  200.     DWORD                                   GetHelpContext          (VOID);
  201.     };
  202.  
  203. /*****************************************************************************
  204. * CdbDBEngine
  205. */
  206. class DLLEXPORT CdbDBEngine : public CdbObject
  207.     {
  208.     public:
  209.  
  210.     // Administration
  211.     CONSTRUCTOR                     CdbDBEngine             (DAODBEngine *peng, BOOL bAddRef=FALSE);
  212.     CONSTRUCTOR                     CdbDBEngine             (BOOL bPrivate=FALSE, BOOL bStart=TRUE, LPCTSTR pstrIniPath=NULL, LPCTSTR pstrDefUser=NULL, LPCTSTR pstrDefPW=NULL, LONG lType=dbUseJet);
  213.     CONSTRUCTOR                     CdbDBEngine             (const CdbDBEngine &);
  214.     CdbDBEngine &           operator =                      (const CdbDBEngine &);
  215.     inline CdbWorkspace     operator []                     (LONG lIndex);
  216.     inline CdbWorkspace     operator []                     (LPCTSTR pstrIndex);
  217.     VOID                            OnInterfaceChange       (VOID);
  218.  
  219.     // Properties
  220.     VOID                            SetDefaultPassword      (LPCTSTR pstr);
  221.     VOID                            SetDefaultUser          (LPCTSTR pstr);
  222.     VOID                            SetIniPath              (LPCTSTR pstr);
  223.     CString                         GetIniPath              (VOID);
  224.     VOID                            SetDefaultType            (LONG l);
  225.     LONG                            GetDefaultType            (VOID);
  226.     VOID                            SetLoginTimeout         (SHORT s);
  227.     SHORT                           GetLoginTimeout         (VOID);
  228.     CString                         GetVersion              (VOID);
  229.     CString                         GetSystemDB             (VOID);
  230.     VOID                            SetSystemDB             (LPCTSTR pstr);
  231.  
  232.     // Methods
  233.     CdbWorkspace                    CreateWorkspace         (LPCTSTR pstrName, LPCTSTR pstrUser, LPCTSTR pstrPassword, LONG lType=-1);
  234.     CdbDatabase                     OpenDatabase            (LPCTSTR pstrName, BOOL bExclusive, BOOL bReadOnly=FALSE, LPCTSTR pstrConnect=NULL);
  235.     CdbDatabase                     OpenDatabase            (LPCTSTR pstrName, LONG lOption=0L, BOOL bReadOnly=FALSE, LPCTSTR pstrConnect=NULL);
  236.     CdbConnection                    OpenConnection            (LPCTSTR pstrName, LONG lOption=-1L, BOOL bReadOnly=FALSE, LPCTSTR pstrConnect=NULL);
  237.     VOID                            CompactDatabase            (LPCTSTR pstrOldDatabase, LPCTSTR pstrNewDatabase, LPCTSTR pstrDstConnect = NULL, LONG lOptions=-1, LPCTSTR pstrSrcConnect = NULL);
  238.     VOID                            RepairDatabase          (LPCTSTR pstrDatabase);
  239.     VOID                            RegisterDatabase        (LPCTSTR pstrDatabase, LPCTSTR pstrDriver, BOOL bSilent, LPCTSTR pstrAttributes);
  240.     VOID                            Idle                    (LONG lOptions=-1);
  241.     VOID                            Start                   (VOID);
  242.     VOID                            SetOption                (long lOption, LPVARIANT pvValue);
  243.     
  244.  
  245.     // Collections
  246.     CdbWorkspaces                    Workspaces;
  247.     CdbErrors                       Errors;
  248.  
  249.     private:
  250.     BOOL                            m_bStarted;
  251.     };
  252.  
  253. /*****************************************************************************
  254. * CdbWorkspace
  255. */
  256. class DLLEXPORT CdbWorkspace : public CdbObject
  257.     {
  258.     public:
  259.  
  260.     // Administration
  261.     CONSTRUCTOR                     CdbWorkspace            (VOID);
  262.     CONSTRUCTOR                     CdbWorkspace            (DAOWorkspace *pwrk, BOOL bAddRef=FALSE);
  263.     CONSTRUCTOR                     CdbWorkspace            (const CdbWorkspace &);
  264.     CdbWorkspace &          operator =                      (const CdbWorkspace &);
  265.     inline CdbDatabase      operator []                     (LONG lIndex);
  266.     inline CdbDatabase      operator []                     (LPCTSTR pstrIndex);
  267.     VOID                            OnInterfaceChange       (VOID);
  268.  
  269.     // Properties
  270.     CString                         GetName                         (VOID);
  271.     VOID                            SetName                         (LPCTSTR pstr);
  272.     CString                         GetUserName                     (VOID);
  273.     BOOL                            GetIsolateODBCTrans                (VOID);
  274.     VOID                            SetIsolateODBCTrans                (BOOL b);
  275.     LONG                            GetType                            (VOID);
  276.     LONG                            GetDefaultCursorDriver            (VOID);
  277.     VOID                            SetDefaultCursorDriver            (LONG l);
  278.     LONG                            GetLoginTimeout                    (VOID);
  279.     VOID                            SetLoginTimeout                    (LONG l);
  280.  
  281.     // Methods
  282.     VOID                            BeginTrans                      (VOID);
  283.     VOID                            CommitTrans                     (LONG lOptions=-1);
  284.     VOID                            Close                           (VOID);
  285.     VOID                            Rollback                        (VOID);
  286.     CdbDatabase                     OpenDatabase            (LPCTSTR pstrName, BOOL bExclusive, BOOL bReadOnly=FALSE, LPCTSTR pstrConnect=NULL);
  287.     CdbDatabase                     OpenDatabase            (LPCTSTR pstrName, LONG lOption=0L, BOOL bReadOnly=FALSE, LPCTSTR pstrConnect=NULL);
  288.     CdbConnection                    OpenConnection            (LPCTSTR pstrName, LONG lOption=-1L, BOOL bReadOnly=FALSE, LPCTSTR pstrConnect=NULL);
  289.     CdbDatabase                     CreateDatabase          (LPCTSTR pstrName, LPCTSTR pstrConnect, LONG lOption=-1);
  290.     CdbUser                         CreateUser                      (LPCTSTR pstrName=NULL, LPCTSTR pstrPID=NULL, LPCTSTR pstrPassword=NULL);
  291.     CdbGroup                        CreateGroup                     (LPCTSTR pstrName=NULL, LPCTSTR pstrPID=NULL);
  292.  
  293.     // Collections
  294.     CdbDatabases                    Databases;
  295.     CdbConnections                    Connections;
  296.     CdbUsers                        Users;
  297.     CdbGroups                       Groups;
  298.     };
  299.  
  300. /*****************************************************************************
  301. * CdbDatabase
  302. */
  303. class DLLEXPORT CdbDatabase : public CdbObject
  304.     {
  305.     public:
  306.  
  307.     // Administration
  308.     CONSTRUCTOR                     CdbDatabase                     (VOID);
  309.     CONSTRUCTOR                     CdbDatabase                     (DAODatabase *pdb, BOOL bAddRef=FALSE);
  310.     CONSTRUCTOR                     CdbDatabase                     (const CdbDatabase &);
  311.     CdbDatabase &           operator =                      (const CdbDatabase &);
  312.     inline CdbTableDef      operator []                     (LONG lIndex);
  313.     inline CdbTableDef      operator []                     (LPCTSTR pstrIndex);
  314.     VOID                            OnInterfaceChange       (VOID);
  315.  
  316.     // Properties
  317.     LONG                    GetCollatingOrder       (VOID);
  318.     CString                 GetConnect              (VOID);
  319.     VOID                    SetConnect                (LPCTSTR pstrConnect);
  320.     CString                 GetName                 (VOID);
  321.     SHORT                   GetQueryTimeout         (VOID);
  322.     VOID                    SetQueryTimeout         (SHORT s);
  323.     BOOL                    GetTransactions         (VOID);
  324.     BOOL                    GetUpdatable            (VOID);
  325.     CString                 GetVersion              (VOID);
  326.     LONG                    GetRecordsAffected      (VOID);
  327.     CdbConnection            GetConnection            (VOID);
  328.     //Replication properties
  329.     CString                    GetReplicaID            (VOID);
  330.     CString                    GetDesignMasterID        (VOID);
  331.     VOID                    SetDesignMasterID        (LPCTSTR pstrMasterID);
  332.  
  333.  
  334.     // Methods
  335.     VOID                    Close                   (VOID);
  336.     VOID                    Execute                 (LPCTSTR pstrQuery, LONG lOption=-1);
  337.     CdbRecordset            OpenRecordset           (LPCTSTR pstrName, LONG lType=-1, LONG lOptions=-1, LONG lLockEdit=-1);
  338.     CdbProperty             CreateProperty          (LPCTSTR pstrName=NULL, LONG lType=-1, LPVARIANT pvValue=NULL, BOOL bDDL=FALSE);
  339.     CdbRelation             CreateRelation          (LPCTSTR pstrName=NULL, LPCTSTR pstrTable=NULL, LPCTSTR pstrForiegn=NULL, LONG lAttributes=-1);
  340.     CdbTableDef             CreateTableDef          (LPCTSTR pstrName=NULL, LONG lAttributes=-1, LPCTSTR pstrSource=NULL, LPCTSTR pstrConnect=NULL);
  341.     CdbQueryDef             CreateQueryDef          (LPCTSTR pstrName=NULL, LPCTSTR pstrSQL=NULL);
  342.     VOID                    NewPassword                (LPCTSTR pstrOld, LPCTSTR pstrNew);
  343.     //Replication methods
  344.     VOID                    Synchronize                (LPCTSTR pstrReplica, LONG lType=-1);
  345.     VOID                    MakeReplica                (LPCTSTR pstrPath, LPCTSTR pstrDescription, LONG lOptions=-1);
  346.     VOID                    PopulatePartial            (LPCTSTR pstrDbPathName);
  347.  
  348.     // Collections
  349.     CdbTableDefs            TableDefs;
  350.     CdbQueryDefs            QueryDefs;
  351.     CdbRelations            Relations;
  352.     CdbContainers           Containers;
  353.     CdbRecordsets           Recordsets;
  354.     };
  355.  
  356. /*****************************************************************************
  357. * CdbConnection
  358. */
  359. class DLLEXPORT CdbConnection : public CdbObject
  360.     {
  361.     public:
  362.  
  363.     // Administration
  364.     CONSTRUCTOR                     CdbConnection           (VOID);
  365.     CONSTRUCTOR                     CdbConnection           (DAOConnection *pconn, BOOL bAddRef=FALSE);
  366.     CONSTRUCTOR                     CdbConnection           (const CdbConnection &);
  367.     CdbConnection &                    operator =              (const CdbConnection &);
  368.     inline CdbQueryDef                operator []             (LONG lIndex);
  369.     inline CdbQueryDef                operator []             (LPCTSTR pstrIndex);
  370.     VOID                            OnInterfaceChange       (VOID);
  371.  
  372.     // Properties
  373.     CString                         GetConnect              (VOID);
  374.     CString                         GetName                 (VOID);
  375.     CdbDatabase                        GetDatabase                (VOID);
  376.     SHORT                           GetQueryTimeout         (VOID);
  377.     VOID                            SetQueryTimeout         (SHORT s);
  378.     LONG                            GetRecordsAffected        (VOID);
  379.     BOOL                            GetStillExecuting        (VOID);
  380.     BOOL                            GetTransactions         (VOID);
  381.     BOOL                            GetUpdatable            (VOID);
  382.  
  383.     // Methods
  384.     VOID                            Cancel                    (VOID);
  385.     VOID                            Close                   (VOID);
  386.     CdbQueryDef                        CreateQueryDef          (LPCTSTR pstrName=NULL, LPCTSTR pstrSQL=NULL);
  387.     VOID                            Execute                 (LPCTSTR pstrQuery, LONG lOption=-1);
  388.     CdbRecordset                    OpenRecordset           (LPCTSTR pstrName, LONG lType=-1, LONG lOptions=-1, LONG lLockEdit=-1);
  389.  
  390.     // Collections
  391.     CdbQueryDefs            QueryDefs;
  392.     CdbRecordsets           Recordsets;
  393.     };
  394.  
  395. /*****************************************************************************
  396. * CdbRecordset
  397. */
  398. class DLLEXPORT CdbRecordset : public CdbObject
  399.     {
  400.     public:
  401.  
  402.     // Administration
  403.     CONSTRUCTOR                     CdbRecordset            (VOID);
  404.     CONSTRUCTOR                     CdbRecordset            (DAORecordset *prs, BOOL bAddRef=FALSE);
  405.     CONSTRUCTOR                     CdbRecordset            (const CdbRecordset &);
  406.     CdbRecordset &          operator =                      (const CdbRecordset &);
  407.     inline CdbField     operator []                     (LONG lIndex);
  408.     inline CdbField     operator []                     (LPCTSTR pstrIndex);
  409.     VOID                            OnInterfaceChange       (VOID);
  410.     VOID                            SetGetRowsExInt            (VOID);
  411.  
  412.     // Properties
  413.     BOOL                            GetBOF                          (VOID);
  414.     CdbBookmark                     GetBookmark                     (VOID);
  415.     VOID                            SetBookmark                     (class CdbBookmark);
  416.     BOOL                            GetBookmarkable         (VOID);
  417.     COleDateTime                    GetDateCreated          (VOID);
  418.     COleDateTime                    GetLastUpdated          (VOID);
  419.     BOOL                            GetEOF                          (VOID);
  420.     CString                         GetFilter                       (VOID);
  421.     VOID                            SetFilter                       (LPCTSTR pstr);
  422.     CString                         GetIndex                        (VOID);
  423.     VOID                            SetIndex                        (LPCTSTR pstr);
  424.     CdbBookmark                     GetLastModified         (VOID);
  425.     BOOL                            GetLockEdits            (VOID);
  426.     VOID                            SetLockEdits            (BOOL b);
  427.     CString                         GetName                         (VOID);
  428.     BOOL                            GetNoMatch                      (VOID);
  429.     CString                         GetSort                         (VOID);
  430.     VOID                            SetSort                         (LPCTSTR pstr);
  431.     BOOL                            GetTransactions         (VOID);
  432.     SHORT                           GetType                         (VOID);
  433.     LONG                            GetRecordCount          (VOID);
  434.     BOOL                            GetUpdatable            (VOID);
  435.     BOOL                            GetRestartable          (VOID);
  436.     CString                         GetValidationText       (VOID);
  437.     CString                         GetValidationRule       (VOID);
  438.     CdbBookmark                     GetCacheStart           (VOID);
  439.     VOID                            SetCacheStart           (CdbBookmark &pbm);
  440.     LONG                            GetCacheSize            (VOID);
  441.     VOID                            SetCacheSize            (LONG l);
  442.     FLOAT                           GetPercentPosition      (VOID);
  443.     VOID                            SetPercentPosition      (FLOAT f);
  444.     LONG                            GetAbsolutePosition     (VOID);
  445.     VOID                            SetAbsolutePosition     (LONG l);
  446.     SHORT                           GetEditMode                (VOID);
  447.     LONG                            GetUpdateOptions        (VOID);
  448.     VOID                            SetUpdateOptions        (LONG l);
  449.     SHORT                           GetRecordStatus            (VOID);
  450.     BOOL                            GetStillExecuting        (VOID);
  451.     LONG                            GetBatchSize            (VOID);
  452.     VOID                            SetBatchSize            (LONG l);
  453.     LONG                            GetBatchCollisionCount    (VOID);
  454.     COleVariant                        GetBatchCollisions        (VOID);
  455.     CdbConnection                    GetConnection            (VOID);
  456.  
  457.     // Methods
  458.     VOID                            CancelUpdate            (short sType = dbUpdateRegular);
  459.     VOID                            AddNew                          (VOID);
  460.     VOID                            Close                           (VOID);
  461.     CdbRecordset                    OpenRecordset           (LONG lType=-1, LONG lOption=-1);
  462.     VOID                            Delete                          (VOID);
  463.     VOID                            Edit                            (VOID);
  464.     VOID                            FindFirst                       (LPCTSTR pstrCriteria);
  465.     VOID                            FindLast                        (LPCTSTR pstrCriteria);
  466.     VOID                            FindNext                        (LPCTSTR pstrCriteria);
  467.     VOID                            FindPrevious            (LPCTSTR pstrCriteria);
  468.     VOID                            MoveFirst                       (VOID);
  469.     VOID                            MoveLast                        (LONG lOptions=-1);
  470.     VOID                            MoveNext                        (VOID);
  471.     VOID                            MovePrevious            (VOID);
  472.     VOID                            Seek                            (LPCTSTR pstrComparison, LONG lNumFields, COleVariant cKey, ...);
  473.     VOID                            Update                          (short sType = dbUpdateRegular, VARIANT_BOOL bForce = FALSE);
  474.     CdbRecordset                    Clone                           (VOID);
  475.     VOID                            Requery                         (CdbQueryDef *pq = NULL);
  476.     VOID                            Move                            (LONG lRows, CdbBookmark *bm=NULL);
  477.     VOID                            FillCache                       (LONG lRows=-1, CdbBookmark *pbm=NULL);
  478.     CdbQueryDef                     CopyQueryDef                    (VOID);
  479.     COleVariant                     GetRows                         (LONG lRows=-1);
  480.     LONG                            GetRowsEx                       (LPVOID pvBuffer, LONG cbRow, LPDAORSETBINDING prb, LONG cBinding, LPVOID pvVarBuffer = NULL, LONG cbVarBuffer = 0, LONG lRows = -1);
  481.     VOID                            Cancel                            (VOID);
  482.     BOOL                            NextRecordset                    (VOID);
  483.  
  484.     inline VOID                        GetFieldV                       (COleVariant &vIndex, COleVariant &vValue);
  485.     inline VOID                     SetFieldV                       (COleVariant &vIndex, LPVARIANT pv);
  486.  
  487.  
  488.     COleVariant                     GetField                        (LPCTSTR pstrIndex);
  489.     COleVariant                     GetField                        (LONG lIndex);
  490.     COleVariant                        GetField                        (COleVariant &vIndex);
  491.     COleVariant                        GetField                        (CString &str){return GetField((LPCTSTR)str);}
  492.  
  493.     VOID                            SetField                        (LPCTSTR pstrIndex, LPVARIANT pv);
  494.     VOID                            SetField                        (LONG lIndex, LPVARIANT pv);
  495.     VOID                            SetField                        (COleVariant &vIndex, LPVARIANT pv);
  496.     VOID                            SetField                        (CString &str, LPVARIANT pv){SetField((LPCTSTR)str, pv);}
  497.  
  498.     // Collections
  499.     CdbFields                       Fields;
  500. protected:
  501.     // GetRowsEx interface
  502.     CdbGetRowsEx            m_GetRowsInt;
  503.     };
  504.  
  505.  
  506. /*****************************************************************************
  507. * CdbField
  508. */
  509. class DLLEXPORT CdbField : public CdbObject
  510.     {
  511.     public:
  512.  
  513.     // Administration
  514.     CONSTRUCTOR                     CdbField                        (VOID);
  515.     CONSTRUCTOR                     CdbField                        (DAOField *pfld, BOOL bAddRef=FALSE);
  516.     CONSTRUCTOR                     CdbField                        (const CdbField &);
  517.     CdbField &                      operator =                      (const CdbField &);
  518.     VOID                            OnInterfaceChange       (VOID);
  519.  
  520.     // Properties
  521.     LONG                            GetCollatingOrder       (VOID);
  522.     SHORT                           GetType                         (VOID);
  523.     VOID                            SetType                         (SHORT s);
  524.     CString                         GetName                         (VOID);
  525.     VOID                            SetName                         (LPCTSTR pstr);
  526.     LONG                            GetSize                         (VOID);
  527.     VOID                            SetSize                         (LONG l);
  528.     CString                         GetSourceField          (VOID);
  529.     CString                         GetSourceTable          (VOID);
  530.     COleVariant                     GetValue                 (VOID);
  531.  
  532.     VOID                            SetValue                (LPVARIANT pv);
  533.     LONG                            GetAttributes           (VOID);
  534.     VOID                            SetAttributes           (LONG l);
  535.     SHORT                           GetOrdinalPosition      (VOID);
  536.     VOID                            SetOrdinalPosition      (SHORT s);
  537.     CString                         GetValidationText       (VOID);
  538.     VOID                            SetValidationText       (LPCTSTR pstr);
  539.     BOOL                            GetValidateOnSet        (VOID);
  540.     VOID                            SetValidateOnSet        (BOOL b);
  541.     CString                         GetValidationRule       (VOID);
  542.     VOID                            SetValidationRule       (LPCTSTR pstr);
  543.     CString                            GetDefaultValue         (VOID);
  544.     VOID                            SetDefaultValue         (LPCTSTR pstr);
  545.     VOID                            SetDefaultValue         (LPVARIANT pv);
  546.     BOOL                            GetRequired             (VOID);
  547.     VOID                            SetRequired             (BOOL b);
  548.     BOOL                            GetAllowZeroLength      (VOID);
  549.     VOID                            SetAllowZeroLength      (BOOL b);
  550.     BOOL                            GetDataUpdatable        (VOID);
  551.     CString                         GetForeignName          (VOID);
  552.     VOID                            SetForeignName          (LPCTSTR pstr);
  553.     COleVariant                     GetOriginalValue        (VOID);
  554.     COleVariant                     GetVisibleValue            (VOID);
  555.  
  556.     // Methods
  557.     VOID                            AppendChunk                     (LPVARIANT pv);
  558.     COleVariant                     GetChunk                        (LONG lOffset, LONG lBytes);
  559.     LONG                            FieldSize                       (VOID);
  560.     CdbProperty                     CreateProperty          (LPCTSTR pstrName=NULL, LONG lType=-1, LPVARIANT pvValue=NULL, BOOL bDDL=FALSE);
  561.     };
  562.  
  563. /*****************************************************************************
  564. * CdbQueryDef
  565. */
  566. class DLLEXPORT CdbQueryDef : public CdbObject
  567.     {
  568.     public:
  569.  
  570.     // Administration
  571.     CONSTRUCTOR                     CdbQueryDef             (VOID);
  572.     CONSTRUCTOR                     CdbQueryDef             (DAOQueryDef *pqd, BOOL bAddRef=FALSE);
  573.     CONSTRUCTOR                     CdbQueryDef             (const CdbQueryDef &);
  574.     CdbQueryDef &           operator =                      (const CdbQueryDef &);
  575.     inline CdbField         operator []                     (LONG lIndex);
  576.     inline CdbField         operator []                     (LPCTSTR pstrIndex);
  577.     VOID                            OnInterfaceChange       (VOID);
  578.  
  579.     // Properties
  580.     COleDateTime                    GetDateCreated          (VOID);
  581.     COleDateTime                    GetLastUpdated          (VOID);
  582.     CString                         GetName                 (VOID);
  583.     VOID                            SetName                 (LPCTSTR pstr);
  584.     SHORT                           GetODBCTimeout          (VOID);
  585.     VOID                            SetODBCTimeout          (SHORT s);
  586.     SHORT                           GetType                 (VOID);
  587.     CString                         GetSQL                  (VOID);
  588.     VOID                            SetSQL                  (LPCTSTR pstr);
  589.     BOOL                            GetUpdatable            (VOID);
  590.     CString                         GetConnect              (VOID);
  591.     VOID                            SetConnect              (LPCTSTR pstr);
  592.     BOOL                            GetReturnsRecords       (VOID);
  593.     VOID                            SetReturnsRecords       (BOOL b);
  594.     LONG                            GetRecordsAffected      (VOID);
  595.     LONG                            GetMaxRecords            (VOID);
  596.     VOID                            SetMaxRecords            (LONG l);
  597.     BOOL                            GetStillExecuting        (VOID);
  598.     LONG                            GetCacheSize            (VOID);
  599.     VOID                            SetCacheSize            (LONG l);
  600.     COleVariant                        GetPrepare                (VOID);
  601.     VOID                            SetPrepare                (LPVARIANT pv);
  602.  
  603.     // Methods
  604.     CdbRecordset                    OpenRecordset           (LONG lType=-1, LONG lOption=-1, LONG lLockEdit=-1);
  605.     VOID                            Execute                 (LONG lOption=-1);
  606.     CdbProperty                     CreateProperty          (LPCTSTR pstrName=NULL, LONG lType=-1, LPVARIANT pvValue=NULL, BOOL bDDL=FALSE);
  607.     VOID                            Close                    (VOID);
  608.     VOID                            Cancel                    (VOID);
  609.  
  610.     // Collections
  611.     CdbFields                       Fields;
  612.     CdbParameters                    Parameters;
  613.     };
  614.  
  615. /*****************************************************************************
  616. * CdbTableDef
  617. */
  618. class DLLEXPORT CdbTableDef : public CdbObject
  619.     {
  620.     public:
  621.  
  622.     // Administration
  623.     CONSTRUCTOR                     CdbTableDef                     (VOID);
  624.     CONSTRUCTOR                     CdbTableDef                     (DAOTableDef *ptd, BOOL bAddRef=FALSE);
  625.     CONSTRUCTOR                     CdbTableDef                     (const CdbTableDef &);
  626.     CdbTableDef &           operator =                      (const CdbTableDef &);
  627.     inline CdbField         operator []                     (LONG lIndex);
  628.     inline CdbField         operator []                     (LPCTSTR pstrIndex);
  629.     VOID                            OnInterfaceChange       (VOID);
  630.  
  631.     // Properties
  632.     LONG                            GetAttributes           (VOID);
  633.     VOID                            SetAttributes           (LONG l);
  634.     CString                         GetConnect                      (VOID);
  635.     VOID                            SetConnect                      (LPCTSTR pstr);
  636.     COleDateTime                    GetDateCreated          (VOID);
  637.     COleDateTime                    GetLastUpdated          (VOID);
  638.     CString                         GetName                         (VOID);
  639.     VOID                            SetName                         (LPCTSTR pstr);
  640.     CString                         GetSourceTableName      (VOID);
  641.     VOID                            SetSourceTableName      (LPCTSTR pstr);
  642.     BOOL                            GetUpdatable            (VOID);
  643.     CString                         GetValidationText       (VOID);
  644.     VOID                            SetValidationText       (LPCTSTR pstr);
  645.     CString                         GetValidationRule       (VOID);
  646.     VOID                            SetValidationRule       (LPCTSTR pstr);
  647.     LONG                            GetRecordCount          (VOID);
  648.     CString                            GetConflictTable        (VOID);
  649.     COleVariant                        GetReplicaFilter        (VOID);
  650.     VOID                            SetReplicaFilter        (LPVARIANT pv);
  651.  
  652.     // Methods
  653.     CdbRecordset                    OpenRecordset           (LONG lType=-1, LONG lOption=-1);
  654.     VOID                            RefreshLink                     (VOID);
  655.     CdbField                        CreateField                     (LPCTSTR pstrName=NULL, LONG lType=-1, LONG lSize=-1);
  656.     CdbIndex                        CreateIndex                     (LPCTSTR pstrName=NULL);
  657.     CdbProperty                     CreateProperty          (LPCTSTR pstrName=NULL, LONG lType=-1, LPVARIANT pvValue=NULL, BOOL bDDL=FALSE);
  658.  
  659.     // Collections
  660.     CdbFields                       Fields;
  661.     CdbIndexes                      Indexes;
  662.     };
  663.  
  664. /*****************************************************************************
  665. * CdbIndex
  666. */
  667. class DLLEXPORT CdbIndex : public CdbObject
  668.     {
  669.     public:
  670.  
  671.     // Administration
  672.     CONSTRUCTOR                     CdbIndex                        (VOID);
  673.     CONSTRUCTOR                     CdbIndex                        (DAOIndex *pidx, BOOL bAddRef=FALSE);
  674.     CONSTRUCTOR                     CdbIndex                        (const CdbIndex &);
  675.     CdbIndex &                      operator =                      (const CdbIndex &);
  676.     inline CdbField         operator []             (LONG lIndex);
  677.     inline CdbField         operator []             (LPCTSTR pstrIndex);
  678.     VOID                            OnInterfaceChange       (VOID);
  679.  
  680.     // Properties
  681.     CString                         GetName                         (VOID);
  682.     VOID                            SetName                         (LPCTSTR pstr);
  683.     BOOL                            GetForeign                      (VOID);
  684.     BOOL                            GetUnique                       (VOID);
  685.     VOID                            SetUnique                       (BOOL b);
  686.     BOOL                            GetClustered            (VOID);
  687.     VOID                            SetClustered            (BOOL b);
  688.     BOOL                            GetRequired                     (VOID);
  689.     VOID                            SetRequired                     (BOOL b);
  690.     BOOL                            GetIgnoreNulls          (VOID);
  691.     VOID                            SetIgnoreNulls          (BOOL b);
  692.     BOOL                            GetPrimary                      (VOID);
  693.     VOID                            SetPrimary                      (BOOL b);
  694.     LONG                            GetDistinctCount        (VOID);
  695.  
  696.     // Methods
  697.     CdbField                        CreateField                     (LPCTSTR pstrName=NULL, LONG lType=-1, LONG lSize=-1);
  698.     CdbProperty                     CreateProperty          (LPCTSTR pstrName=NULL, LONG lType=-1, LPVARIANT pvValue=NULL, BOOL bDDL=FALSE);
  699.  
  700.     // Collections
  701.     CdbIndexFields          Fields;
  702.     };
  703.  
  704. /*****************************************************************************
  705. * CdbParameter
  706. */
  707. class DLLEXPORT CdbParameter : public CdbObject
  708.     {
  709.     public:
  710.  
  711.     // Administration
  712.     CONSTRUCTOR                     CdbParameter            (VOID);
  713.     CONSTRUCTOR                     CdbParameter            (DAOParameter *pprm, BOOL bAddRef=FALSE);
  714.     CONSTRUCTOR                     CdbParameter            (const CdbParameter &);
  715.     CdbParameter &          operator =                      (const CdbParameter &);
  716.     VOID                            OnInterfaceChange       (VOID);
  717.  
  718.     // Properties
  719.     CString                         GetName                    (VOID);
  720.     COleVariant                     GetValue                (VOID);
  721.     VOID                            SetValue                (LPVARIANT pv);
  722.     SHORT                           GetType                    (VOID);
  723.     VOID                            SetType                    (SHORT i);
  724.     SHORT                            GetDirection            (VOID);
  725.     VOID                            SetDirection            (SHORT i);
  726.     };
  727.  
  728. /*****************************************************************************
  729. * CdbRelation
  730. */
  731. class DLLEXPORT CdbRelation : public CdbObject
  732.     {
  733.     public:
  734.  
  735.     // Administration
  736.     CONSTRUCTOR                     CdbRelation                     (VOID);
  737.     CONSTRUCTOR                     CdbRelation                     (DAORelation *prl, BOOL bAddRef=FALSE);
  738.     CONSTRUCTOR                     CdbRelation                     (const CdbRelation &);
  739.     CdbRelation &           operator =                      (const CdbRelation &);
  740.     inline CdbField         operator []                     (LONG lIndex);
  741.     inline CdbField         operator []                     (LPCTSTR pstrIndex);
  742.     VOID                            OnInterfaceChange       (VOID);
  743.  
  744.     // Properties
  745.     CString                         GetName                         (VOID);
  746.     VOID                            SetName                         (LPCTSTR pstr);
  747.     CString                         GetTable                        (VOID);
  748.     VOID                            SetTable                        (LPCTSTR pstr);
  749.     CString                         GetForeignTable         (VOID);
  750.     VOID                            SetForeignTable         (LPCTSTR pstr);
  751.     LONG                            GetAttributes           (VOID);
  752.     VOID                            SetAttributes           (LONG);
  753.     BOOL                            GetPartialReplica        (VOID);
  754.     VOID                            SetPartialReplica        (BOOL b);
  755.  
  756.     // Methods
  757.     CdbField                        CreateField                     (LPCTSTR pstrName=NULL, LONG lType=-1, LONG lSize=-1);
  758.  
  759.     // Collections
  760.     CdbFields                       Fields;
  761.     };
  762.  
  763. /*****************************************************************************
  764. * CdbUser
  765. */
  766. class DLLEXPORT CdbUser : public CdbObject
  767.     {
  768.     public:
  769.  
  770.     // Administration
  771.     CONSTRUCTOR                     CdbUser                         (VOID);
  772.     CONSTRUCTOR                     CdbUser                         (DAOUser *pusr, BOOL bAddRef=FALSE);
  773.     CONSTRUCTOR                     CdbUser                         (const CdbUser &);
  774.     CdbUser &                       operator =                      (const CdbUser &);
  775.     inline CdbGroup         operator []                     (LONG lIndex);
  776.     inline CdbGroup         operator []                     (LPCTSTR pstrIndex);
  777.     VOID                            OnInterfaceChange       (VOID);
  778.  
  779.     // Properties
  780.     CString                         GetName                         (VOID);
  781.     VOID                            SetName                         (LPCTSTR pstr);
  782.     VOID                            SetPID                          (LPCTSTR pstr);
  783.     VOID                            SetPassword                     (LPCTSTR pstr);
  784.  
  785.     // Methods
  786.     VOID                            NewPassword                     (LPCTSTR pstrOld, LPCTSTR pstrNew);
  787.     CdbGroup                        CreateGroup                     (LPCTSTR pstrName=NULL, LPCTSTR pstrPID=NULL);
  788.  
  789.     // Collections
  790.     CdbGroups                       Groups;
  791.     };
  792.  
  793. /*****************************************************************************
  794. * CdbGroup
  795. */
  796. class DLLEXPORT CdbGroup : public CdbObject
  797.     {
  798.     public:
  799.  
  800.     // Administration
  801.     CONSTRUCTOR                     CdbGroup                        (VOID);
  802.     CONSTRUCTOR                     CdbGroup                        (DAOGroup *pgrp, BOOL bAddRef=FALSE);
  803.     CONSTRUCTOR                     CdbGroup                        (const CdbGroup &);
  804.     CdbGroup &                      operator =                      (const CdbGroup &);
  805.     inline CdbUser          operator []                     (LONG lIndex);
  806.     inline CdbUser          operator []                     (LPCTSTR pstrIndex);
  807.     VOID                            OnInterfaceChange       (VOID);
  808.  
  809.     // Properties
  810.     CString                         GetName                         (VOID);
  811.     VOID                            SetName                         (LPCTSTR pstr);
  812.     VOID                            SetPID                          (LPCTSTR pstr);
  813.  
  814.     // Methods
  815.     CdbUser                         CreateUser                      (LPCTSTR pstrName=NULL, LPCTSTR pstrPID=NULL, LPCTSTR pstrPassword=NULL);
  816.  
  817.     // Collections
  818.     CdbUsers                        Users;
  819.     };
  820.  
  821. /*****************************************************************************
  822. * CdbDocument
  823. */
  824. class DLLEXPORT CdbDocument : public CdbObject
  825.     {
  826.     public:
  827.  
  828.     // Administration
  829.     CONSTRUCTOR                     CdbDocument                     (VOID);
  830.     CONSTRUCTOR                     CdbDocument                     (DAODocument *pdoc, BOOL bAddRef=FALSE);
  831.     CONSTRUCTOR                     CdbDocument                     (const CdbDocument &);
  832.     CdbDocument &           operator =                      (const CdbDocument &);
  833.     VOID                            OnInterfaceChange       (VOID);
  834.  
  835.     // Properties
  836.     CString                         GetName                         (VOID);
  837.     CString                         GetOwner                        (VOID);
  838.     VOID                            SetOwner                        (LPCTSTR pstr);
  839.     CString                         GetContainer            (VOID);
  840.     CString                         GetUserName                     (VOID);
  841.     VOID                            SetUserName                     (LPCTSTR pstr);
  842.     LONG                            GetPermissions          (VOID);
  843.     VOID                            SetPermissions          (LONG l);
  844.     COleDateTime                    GetDateCreated          (VOID);
  845.     COleDateTime                    GetLastUpdated          (VOID);
  846.     LONG                            GetAllPermissions        (VOID);
  847.     //Methods
  848.     CdbProperty                        CreateProperty          (LPCTSTR pstrName=NULL, LONG lType=-1, LPVARIANT pvValue=NULL, BOOL bDDL=FALSE);
  849.     };
  850.  
  851. /*****************************************************************************
  852. * CdbContainer
  853. */
  854. class DLLEXPORT CdbContainer : public CdbObject
  855.     {
  856.     public:
  857.  
  858.     // Administration
  859.     CONSTRUCTOR                     CdbContainer            (VOID);
  860.     CONSTRUCTOR                     CdbContainer            (DAOContainer *pctn, BOOL bAddRef=FALSE);
  861.     CONSTRUCTOR                     CdbContainer            (const CdbContainer &);
  862.     CdbContainer &          operator =                      (const CdbContainer &);
  863.     inline CdbDocument      operator []                     (LONG lIndex);
  864.     inline CdbDocument      operator []                     (LPCTSTR pstrIndex);
  865.     VOID                            OnInterfaceChange       (VOID);
  866.  
  867.     // Properties
  868.     CString                         GetName                         (VOID);
  869.     CString                         GetOwner                        (VOID);
  870.     VOID                            SetOwner                        (LPCTSTR pstr);
  871.     CString                         GetUserName                     (VOID);
  872.     VOID                            SetUserName                     (LPCTSTR pstr);
  873.     LONG                            GetPermissions          (VOID);
  874.     VOID                            SetPermissions          (LONG l);
  875.     BOOL                            GetInherit                      (VOID);
  876.     VOID                            SetInherit                      (BOOL b);
  877.     LONG                            GetAllPermissions        (VOID);
  878.  
  879.     // Collections
  880.     CdbDocuments            Documents;
  881.     };
  882.  
  883. /*****************************************************************************
  884. * CdbError
  885. */
  886. class DLLEXPORT CdbError : public CdbObject
  887.     {
  888.     public:
  889.  
  890.     // Administration
  891.     CONSTRUCTOR                     CdbError                        (VOID);
  892.     CONSTRUCTOR                     CdbError                        (DAOError *perr, BOOL bAddRef=FALSE);
  893.     CONSTRUCTOR                     CdbError                        (const CdbError &);
  894.     CdbError &                      operator =                      (const CdbError &);
  895.     VOID                            OnInterfaceChange       (VOID);
  896.  
  897.     // Properties
  898.     LONG                            GetNumber                       (VOID);
  899.     CString                         GetSource                       (VOID);
  900.     CString                         GetDescription          (VOID);
  901.     CString                         GetHelpFile                     (VOID);
  902.     LONG                            GetHelpContext          (VOID);
  903.     };
  904.  
  905. /*****************************************************************************
  906. * CdbProperty
  907. */
  908. class DLLEXPORT CdbProperty : public CdbObject
  909.     {
  910.     public:
  911.  
  912.     // Administration
  913.     CONSTRUCTOR                     CdbProperty                     (VOID);
  914.     CONSTRUCTOR                     CdbProperty                     (DAOProperty *pprp, BOOL bAddRef=FALSE);
  915.     CONSTRUCTOR                     CdbProperty                     (const CdbProperty &);
  916.     CdbProperty &           operator =                      (const CdbProperty &);
  917.  
  918.     // Properties
  919.     COleVariant                     GetValue                        (VOID);
  920.     VOID                            SetValue                        (LPVARIANT pv);
  921.     CString                         GetName                         (VOID);
  922.     VOID                            SetName                         (LPCTSTR pstrName);
  923.     SHORT                           GetType                         (VOID);
  924.     VOID                            SetType                         (SHORT sType);
  925.     BOOL                            GetInherited            (VOID);
  926.     };
  927.  
  928.  
  929. /*****************************************************************************
  930. *  Inline functions
  931. */
  932. inline BOOL    CdbOleObject::Exists(void)
  933.     { 
  934.     return (m_punkInterface ? TRUE : FALSE);
  935.     }
  936.  
  937. /*****************************************************************************
  938. *  Recordset GetField functions
  939. */
  940.  
  941.  
  942. inline VOID                CdbRecordset::GetFieldV(
  943.     COleVariant &vIndex,
  944.     COleVariant &vValue)
  945. {
  946.     DAORecordset *  prs     = (DAORecordset *)GetInterface();
  947.  
  948.     if (!prs)
  949.         {
  950.         DAOVINIT(vValue);
  951.         return;
  952.         }
  953.  
  954.     DAOMFC_CALL(prs->get_Collect(vIndex, &vValue));
  955.  
  956.     return;
  957. }
  958.  
  959. inline VOID                CdbRecordset::SetFieldV(
  960.     COleVariant &vIndex, 
  961.     LPVARIANT pv)
  962. {
  963.     DAORecordset *  prs     = (DAORecordset *)GetInterface();
  964.  
  965.     if (!prs)
  966.         return;
  967.  
  968.     DAOMFC_CALL(prs->put_Collect(vIndex, *pv));
  969. }
  970.  
  971.  
  972. /*****************************************************************************
  973. * Default collection operators
  974. */
  975. inline CdbWorkspace CdbDBEngine::operator []
  976.     (LONG lIndex)
  977. {
  978. return Workspaces[lIndex];
  979. }
  980.  
  981. inline CdbWorkspace CdbDBEngine::operator []
  982.     (LPCTSTR pstrIndex)
  983. {
  984. return Workspaces[pstrIndex];
  985. }
  986.  
  987.  
  988. inline CdbDatabase CdbWorkspace::operator []
  989.     (LONG lIndex)
  990. {
  991. return Databases[lIndex];
  992. }
  993.  
  994. inline CdbDatabase CdbWorkspace::operator []
  995.     (LPCTSTR pstrIndex)
  996. {
  997. return Databases[pstrIndex];
  998. }
  999.  
  1000. inline CdbTableDef      CdbDatabase::operator []
  1001.     (LONG lIndex)
  1002. {
  1003. return TableDefs[lIndex];
  1004. }
  1005.  
  1006. inline CdbTableDef      CdbDatabase::operator []
  1007.     (LPCTSTR pstrIndex)
  1008. {
  1009. return TableDefs[pstrIndex];
  1010. }
  1011.  
  1012. inline CdbQueryDef      CdbConnection::operator []
  1013.     (LONG lIndex)
  1014. {
  1015. return QueryDefs[lIndex];
  1016. }
  1017.  
  1018. inline CdbQueryDef      CdbConnection::operator []
  1019.     (LPCTSTR pstrIndex)
  1020. {
  1021. return QueryDefs[pstrIndex];
  1022. }
  1023.  
  1024. inline CdbField      CdbRecordset::operator []
  1025.     (LONG lIndex)
  1026. {
  1027. return Fields[lIndex];
  1028. }
  1029.  
  1030. inline CdbField      CdbRecordset::operator []
  1031.     (LPCTSTR pstrIndex)
  1032. {
  1033. return Fields[pstrIndex];
  1034. }
  1035.  
  1036.  
  1037.  
  1038. inline CdbField CdbTableDef::operator []        
  1039.     (LONG lIndex)
  1040. {
  1041. return Fields[lIndex];
  1042. }
  1043.  
  1044. inline CdbField CdbTableDef::operator []        
  1045.     (LPCTSTR pstrIndex)
  1046. {
  1047. return Fields[pstrIndex];
  1048. }
  1049.  
  1050. inline CdbField CdbQueryDef::operator []        
  1051.     (LONG lIndex)
  1052. {
  1053. return Fields[lIndex];
  1054. }
  1055.  
  1056. inline CdbField CdbQueryDef::operator []        
  1057.     (LPCTSTR pstrIndex)
  1058. {
  1059. return Fields[pstrIndex];
  1060. }
  1061.  
  1062. inline CdbField CdbIndex::operator []   
  1063.     (LONG lIndex)
  1064. {
  1065. return Fields[lIndex];
  1066. }
  1067.  
  1068. inline CdbField CdbIndex::operator []   
  1069.     (LPCTSTR pstrIndex)
  1070. {
  1071. return Fields[pstrIndex];
  1072. }
  1073.  
  1074. inline CdbField CdbRelation::operator []
  1075.     (LONG lIndex)
  1076. {
  1077. return Fields[lIndex];
  1078. }
  1079.  
  1080. inline CdbField CdbRelation::operator []
  1081.     (LPCTSTR pstrIndex)
  1082. {
  1083. return Fields[pstrIndex];
  1084. }
  1085.  
  1086. inline CdbGroup CdbUser::operator []
  1087.     (LONG lIndex)
  1088. {
  1089. return Groups[lIndex];
  1090. }
  1091.  
  1092. inline CdbGroup CdbUser::operator []
  1093.     (LPCTSTR pstrIndex)
  1094. {
  1095. return Groups[pstrIndex];
  1096. }
  1097.  
  1098. inline CdbUser CdbGroup::operator []
  1099.     (LONG lIndex)
  1100. {
  1101. return Users[lIndex];
  1102. }
  1103.  
  1104. inline CdbUser CdbGroup::operator []
  1105.     (LPCTSTR pstrIndex)
  1106. {
  1107. return Users[pstrIndex];
  1108. }
  1109.  
  1110. inline CdbDocument CdbContainer::operator []
  1111.     (LONG lIndex)
  1112. {
  1113. return Documents[lIndex];
  1114. }
  1115.  
  1116. inline CdbDocument CdbContainer::operator []
  1117.     (LPCTSTR pstrIndex)
  1118. {
  1119. return Documents[pstrIndex];
  1120. }
  1121.  
  1122. /*****************************************************************************
  1123. *  Use different DAO interface for wide (UNICODE) versions
  1124. */
  1125.  
  1126. #ifdef _UNICODE
  1127.  
  1128. #define dbIID_IDAODBEngine IID_IDAODBEngineW
  1129. #define dbIID_IDAOError IID_IDAOErrorW
  1130. #define dbIID_IDAOErrors IID_IDAOErrorsW
  1131. #define dbIID_IDAOProperty IID_IDAOPropertyW
  1132. #define dbIID_IDAOProperties IID_IDAOPropertiesW
  1133. #define dbIID_IDAORecordset IID_IDAORecordsetW
  1134. #define dbIID_IDAORecordsets IID_IDAORecordsetsW
  1135. #define dbIID_IDAOWorkspace IID_IDAOWorkspaceW
  1136. #define dbIID_IDAOWorkspaces IID_IDAOWorkspacesW
  1137. #define dbIID_IDAOConnection IID_IDAOConnectionW
  1138. #define dbIID_IDAOConnections IID_IDAOConnectionsW
  1139. #define dbIID_IDAOTableDef IID_IDAOTableDefW
  1140. #define dbIID_IDAOTableDefs IID_IDAOTableDefsW
  1141. #define dbIID_IDAOField IID_IDAOFieldW
  1142. #define dbIID_IDAOFields IID_IDAOFieldsW
  1143. #define dbIID_IDAOIndex IID_IDAOIndexW
  1144. #define dbIID_IDAOIndexes IID_IDAOIndexesW
  1145. #define dbIID_IDAOIndexFields IID_IDAOIndexFieldsW
  1146. #define dbIID_IDAOGroup IID_IDAOGroupW
  1147. #define dbIID_IDAOGroups IID_IDAOGroupsW
  1148. #define dbIID_IDAOUser IID_IDAOUserW
  1149. #define dbIID_IDAOUsers IID_IDAOUsersW
  1150. #define dbIID_IDAODatabase IID_IDAODatabaseW
  1151. #define dbIID_IDAODatabases IID_IDAODatabasesW
  1152. #define dbIID_IDAOQueryDef IID_IDAOQueryDefW
  1153. #define dbIID_IDAOQueryDefs IID_IDAOQueryDefsW
  1154. #define dbIID_IDAOParameter IID_IDAOParameterW
  1155. #define dbIID_IDAOParameters IID_IDAOParametersW
  1156. #define dbIID_IDAORelation IID_IDAORelationW
  1157. #define dbIID_IDAORelations IID_IDAORelationsW
  1158. #define dbIID_IDAOContainer IID_IDAOContainerW
  1159. #define dbIID_IDAOContainers IID_IDAOContainersW
  1160. #define dbIID_IDAODocument IID_IDAODocumentW
  1161. #define dbIID_IDAODocuments IID_IDAODocumentsW
  1162.  
  1163. #else
  1164.  
  1165. #define dbIID_IDAODBEngine IID_IDAODBEngine
  1166. #define dbIID_IDAOError IID_IDAOError
  1167. #define dbIID_IDAOErrors IID_IDAOErrors
  1168. #define dbIID_IDAOProperty IID_IDAOProperty
  1169. #define dbIID_IDAOProperties IID_IDAOProperties
  1170. #define dbIID_IDAORecordset IID_IDAORecordset
  1171. #define dbIID_IDAORecordsets IID_IDAORecordsets
  1172. #define dbIID_IDAOWorkspace IID_IDAOWorkspace
  1173. #define dbIID_IDAOWorkspaces IID_IDAOWorkspaces
  1174. #define dbIID_IDAOConnection IID_IDAOConnection
  1175. #define dbIID_IDAOConnections IID_IDAOConnections
  1176. #define dbIID_IDAOTableDef IID_IDAOTableDef
  1177. #define dbIID_IDAOTableDefs IID_IDAOTableDefs
  1178. #define dbIID_IDAOField IID_IDAOField
  1179. #define dbIID_IDAOFields IID_IDAOFields
  1180. #define dbIID_IDAOIndex IID_IDAOIndex
  1181. #define dbIID_IDAOIndexes IID_IDAOIndexes
  1182. #define dbIID_IDAOIndexFields IID_IDAOIndexFields
  1183. #define dbIID_IDAOGroup IID_IDAOGroup
  1184. #define dbIID_IDAOGroups IID_IDAOGroups
  1185. #define dbIID_IDAOUser IID_IDAOUser
  1186. #define dbIID_IDAOUsers IID_IDAOUsers
  1187. #define dbIID_IDAODatabase IID_IDAODatabase
  1188. #define dbIID_IDAODatabases IID_IDAODatabases
  1189. #define dbIID_IDAOQueryDef IID_IDAOQueryDef
  1190. #define dbIID_IDAOQueryDefs IID_IDAOQueryDefs
  1191. #define dbIID_IDAOParameter IID_IDAOParameter
  1192. #define dbIID_IDAOParameters IID_IDAOParameters
  1193. #define dbIID_IDAORelation IID_IDAORelation
  1194. #define dbIID_IDAORelations IID_IDAORelations
  1195. #define dbIID_IDAOContainer IID_IDAOContainer
  1196. #define dbIID_IDAOContainers IID_IDAOContainers
  1197. #define dbIID_IDAODocument IID_IDAODocument
  1198. #define dbIID_IDAODocuments IID_IDAODocuments
  1199.  
  1200. #endif
  1201.  
  1202.  
  1203.  
  1204. #pragma option pop /*P_O_Pop*/
  1205. #endif // _DBDAO_H_ 
  1206.