home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 September / VPR0009A.BIN / VS60SP4JPN / support / daogetrw.h < prev    next >
Text File  |  1998-12-12  |  5KB  |  156 lines

  1. /************************************************************************
  2. **  D A O G E T R W . H                                                 *
  3. **                                                                      *
  4. **  GetRows interface                                                   *
  5. **                                                                      *
  6. **  Warning: This file is copied from cdaost.h. Changes must be made    *
  7. **           in both files                                              *
  8. **                                                                      *
  9. **                                                                      *
  10. *************************************************************************
  11. ** Copyright (C) 1995 by Microsoft Corporation                          *
  12. **         All Rights Reserved                                          *
  13. ************************************************************************/
  14.  
  15. #if !defined (_DAOGETRW_H_)
  16. #define _DAOGETRW_H_
  17.  
  18. /*
  19.     Enumerations
  20. */
  21. typedef enum
  22.     {
  23.     DAOCOLKIND_IND = 0,
  24.     DAOCOLKIND_STR,
  25.     DAOCOLKIND_WSTR
  26.     } DAOCOLKIND;
  27.  
  28. typedef enum
  29.     {
  30.     DAO_I2 = 0,
  31.     DAO_I4,
  32.     DAO_R4,
  33.     DAO_R8,
  34.     DAO_CURRENCY,
  35.     DAO_DATE,
  36.     DAO_BOOL,
  37.     DAO_BSTR,
  38.     DAO_LPSTR,
  39.     DAO_LPWSTR,
  40.     DAO_BLOB,
  41.     DAO_BYTES,
  42.     DAO_CHAR,
  43.     DAO_WCHAR,
  44.     DAO_ANYVARIANT,
  45.     DAO_BOOKMARK,
  46.     DAO_BYTE,
  47.     DAO_GUID,
  48.     DAO_DATATYPEMAX
  49.     } DAODATATYPE;
  50.  
  51. /*
  52.     Macros
  53. */
  54. #define DAO_NOINDICATOR 0xffffffff
  55. #define DAO_NULL        0xffffffff
  56. #define DAO_CANTCOERCE  0xfffffffc
  57. #define DAO_NOMAXLENGTH 0x00000000
  58.  
  59. #define DAOROWFETCH_CALLEEALLOCATES     0x00000001
  60. #define DAOROWFETCH_DONTADVANCE         0x00000002
  61. #define DAOROWFETCH_FORCEREFRESH        0x00000004
  62. #define DAOROWFETCH_BINDABSOLUTE        0x00000008
  63. #define DAOROWFETCH_ODBCNEXT            0x00000010
  64.  
  65. #define DAOBINDING_DIRECT               0x00000001
  66. #define DAOBINDING_VARIANT              0x00000002
  67. #define DAOBINDING_CALLBACK             0x00000004
  68.  
  69. /*
  70.     Structures
  71. */
  72. typedef struct
  73.     {
  74.     DWORD           dwKind;
  75.     union
  76.         {
  77.         LONG        ind;
  78.         LPCSTR      lpstr;
  79.         LPCWSTR        lpwstr;
  80.         };
  81.     } DAOCOLUMNID;
  82. typedef DAOCOLUMNID *LPDAOCOLUMNID;
  83.  
  84. // Callback for binding
  85. EXTERN_C typedef HRESULT (STDAPICALLTYPE *LPDAOBINDFUNC)(ULONG cb, DWORD dwUser, LPVOID *ppData);
  86. #define DAOBINDINGFUNC(f)   STDAPI f (ULONG cb, DWORD dwUser, LPVOID *ppData)
  87.  
  88. typedef struct
  89.     {
  90.     DAOCOLUMNID     columnID;
  91.     ULONG           cbDataOffset;
  92.     ULONG           cbMaxLen;
  93.     ULONG           cbInfoOffset;
  94.     DWORD           dwBinding;
  95.     DWORD           dwDataType;
  96.     DWORD           dwUser;
  97.     } DAOCOLUMNBINDING;
  98. typedef DAOCOLUMNBINDING *LPDAOCOLUMNBINDING;
  99.  
  100. typedef struct
  101.     {
  102.     ULONG           cRowsRequested;
  103.     DWORD           dwFlags;
  104.     LPVOID          pData;
  105.     LPVOID          pVarData;
  106.     ULONG           cbVarData;
  107.     ULONG           cRowsReturned;
  108.     } DAOFETCHROWS;
  109. typedef DAOFETCHROWS *LPDAOFETCHROWS;
  110.  
  111. /*
  112.     New Errors
  113.  
  114.     **NOTE: OLE standard ids to be determined.
  115. */
  116. #define S_BUFFERTOOSMALL    MAKE_SCODE(SEVERITY_SUCCESS,    FACILITY_ITF,   0x1000)
  117. #define S_ENDOFCURSOR       MAKE_SCODE(SEVERITY_SUCCESS,    FACILITY_ITF,   0x1001)
  118. #define S_SILENTCANCEL      MAKE_SCODE(SEVERITY_SUCCESS,    FACILITY_ITF,   0x1002)
  119. #define S_RECORDDELETED     MAKE_SCODE(SEVERITY_SUCCESS,    FACILITY_ITF,   0x1003)
  120.  
  121. #define E_ROWTOOSHORT       MAKE_SCODE(SEVERITY_ERROR,      FACILITY_ITF,   0x1000)
  122. #define E_BADBINDINFO       MAKE_SCODE(SEVERITY_ERROR,      FACILITY_ITF,   0x1001)
  123. #define E_COLUMNUNAVAILABLE MAKE_SCODE(SEVERITY_ERROR,      FACILITY_ITF,   0x1002)
  124.  
  125.  
  126. /*
  127.     Interfaces
  128. */
  129. #undef INTERFACE
  130. #define INTERFACE ICDAORecordset
  131. DECLARE_INTERFACE_(ICDAORecordset, IDispatch)
  132.     {
  133.     STDMETHOD(GetRows)          (THIS_ LONG cRowsToSkip, LONG cCol, LPDAOCOLUMNBINDING prgBndCol, ULONG cbRowLen, LPDAOFETCHROWS pFetchRows) PURE;
  134.     STDMETHOD(SetNotify)        (THIS_ REFIID riid, BOOL fNotify);
  135.     STDMETHOD(GetNotify)        (THIS_ REFIID riid, BOOL *fNotify);
  136.     STDMETHOD(OnBeforeNotify)    (THIS_ REFIID riid, DWORD cat, DWORD rsn, VARIANT v1, VARIANT v2);
  137.     STDMETHOD(OnAfterNotify)    (THIS_ REFIID riid, DWORD cat, DWORD rsn, VARIANT v1, VARIANT v2, HRESULT hr);
  138.     STDMETHOD(PutLock)            (THIS_ BOOL f);
  139.     STDMETHOD(GetLock)            (THIS_ BOOL *f);
  140.     STDMETHOD(AddGetRowsErr)    (THIS_ HRESULT hr) PURE;
  141.     STDMETHOD(GetJetIDs)        (unsigned long *pSesid, unsigned long *pDbid, unsigned long *pTableID) PURE;//For Access forms recordsets 3/98 jcm
  142.     STDMETHOD(GetForwardOnlyFlag)(THIS_ BOOL *f);//For Access forms recordsets 6/98 jcm
  143.     STDMETHOD(GetWorkspace)        (DAOWorkspace **) PURE;//For Access forms recordsets 11/98 jcm
  144.     };
  145.  
  146. //Get rows errors
  147. #define errVtoFetchBuffTooSmall    -30028    //3640    The fetch buffer was too small for the amount of data you requested.
  148. #define errVtoEOFDuringFetch    -30029    //3641    There are fewer records remaining in the recordset than you requested.
  149. #define errVtoSilentCancel        -30030    //3642    A cancel was performed on the operation.
  150. #define errVtoRecordDeleted        -30031    //3643    One of the records in the recordset was deleted by another process.
  151. #define errVtoRowLenTooSmall    -30032    //3646    The specified row length is shorter than the sum of the column lengths.
  152. #define errVtoBadBindInfo        -30033    //3645    One of the binding parameters is incorrect.
  153. #define errVtoColumnMissing        -30034    //3647    A column requested is not being returned to the recordset.
  154.  
  155. #endif // _DAOGETRW_H_
  156.