home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Internet Business Development Kit / PRODUCT_CD.iso / sqlsvr / odbcsdk / samples / smpldrvr / results.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-07  |  3.1 KB  |  168 lines

  1. /*
  2. ** RESULTS.C - This is the ODBC sample driver code for
  3. ** returning results and information about results.
  4. **
  5. **    This code is furnished on an as-is basis as part of the ODBC SDK and is
  6. **    intended for example purposes only.
  7. **
  8. */
  9.  
  10. //    -    -    -    -    -    -    -    -    -
  11.  
  12. #include "sample.h"
  13.  
  14. //    -    -    -    -    -    -    -    -    -
  15.  
  16. //    This returns the number of columns associated with the database
  17. //    attached to "hstmt".
  18.  
  19. RETCODE SQL_API SQLNumResultCols(
  20.     HSTMT      hstmt,
  21.     SWORD FAR *pccol)
  22. {
  23.     return SQL_SUCCESS;
  24. }
  25.  
  26. //    -    -    -    -    -    -    -    -    -
  27.  
  28. //    Return information about the database column the user wants
  29. //    information about.
  30.  
  31. RETCODE SQL_API SQLDescribeCol(
  32.     HSTMT       hstmt,
  33.     UWORD       icol,
  34.     UCHAR  FAR *szColName,
  35.     SWORD       cbColNameMax,
  36.     SWORD  FAR *pcbColName,
  37.     UNALIGNED SWORD  FAR *pfSqlType,
  38.     UNALIGNED UDWORD FAR *pcbColDef,
  39.     UNALIGNED SWORD  FAR *pibScale,
  40.     SWORD  FAR *pfNullable)
  41. {
  42.     return SQL_SUCCESS;
  43. }
  44.  
  45. //    -    -    -    -    -    -    -    -    -
  46.  
  47. //    Returns result column descriptor information for a result set.
  48.  
  49. RETCODE SQL_API SQLColAttributes(
  50.     HSTMT       hstmt,
  51.     UWORD       icol,
  52.     UWORD       fDescType,
  53.     PTR        rgbDesc,
  54.     SWORD       cbDescMax,
  55.     SWORD  FAR *pcbDesc,
  56.     SDWORD FAR *pfDesc)
  57. {
  58.     return SQL_SUCCESS;
  59. }
  60.  
  61. //    -    -    -    -    -    -    -    -    -
  62.  
  63. //    Associate a user-supplied buffer with a database column.
  64.  
  65. RETCODE SQL_API SQLBindCol(
  66.     HSTMT       hstmt,
  67.     UWORD       icol,
  68.     SWORD       fCType,
  69.     PTR        rgbValue,
  70.     SDWORD       cbValueMax,
  71.     SDWORD FAR *pcbValue)
  72. {
  73.     return SQL_SUCCESS;
  74. }
  75.  
  76. //    -    -    -    -    -    -    -    -    -
  77.  
  78. //    Returns data for bound columns in the current row ("hstmt->iCursor"),
  79. //    advances the cursor.
  80.  
  81. RETCODE SQL_API SQLFetch(
  82.     HSTMT    hstmt)
  83. {
  84.     return SQL_SUCCESS;
  85. }
  86.  
  87. //    Returns result data for a single column in the current row.
  88.  
  89. RETCODE SQL_API SQLGetData(
  90.     HSTMT       hstmt,
  91.     UWORD       icol,
  92.     SWORD       fCType,
  93.     PTR        rgbValue,
  94.     SDWORD       cbValueMax,
  95.     SDWORD FAR *pcbValue)
  96. {
  97.     return SQL_SUCCESS;
  98. }
  99.  
  100. //    -    -    -    -    -    -    -    -    -
  101.  
  102. //    This determines whether there are more results sets available for
  103. //    the "hstmt".
  104.  
  105. RETCODE SQL_API SQLMoreResults(
  106.     HSTMT    hstmt)
  107. {
  108.     return SQL_SUCCESS;
  109. }
  110.  
  111. //    -    -    -    -    -    -    -    -    -
  112.  
  113. //    This returns the number of rows associated with the database
  114. //    attached to "hstmt".
  115.  
  116. RETCODE SQL_API SQLRowCount(
  117.     HSTMT       hstmt,
  118.     SDWORD FAR *pcrow)
  119. {
  120.     return SQL_SUCCESS;
  121. }
  122.  
  123. //    -    -    -    -    -    -    -    -    -
  124.  
  125. //    This positions the cursor within a block of data.
  126.  
  127. RETCODE SQL_API SQLSetPos(
  128.     HSTMT    hstmt,
  129.     UWORD    irow,
  130.     UWORD    fOption,
  131.     UWORD    fLock)
  132. {
  133.     return SQL_SUCCESS;
  134. }
  135.  
  136. //    -    -    -    -    -    -    -    -    -
  137.  
  138. //    This fetchs a block of data (rowset).
  139.  
  140. RETCODE SQL_API SQLExtendedFetch(
  141.     HSTMT       hstmt,
  142.     UWORD       fFetchType,
  143.     SDWORD       irow,
  144.     UDWORD FAR *pcrow,
  145.     UWORD  FAR *rgfRowStatus)
  146. {
  147.     return SQL_SUCCESS;
  148. }
  149.  
  150. //    -    -    -    -    -    -    -    -    -
  151.  
  152. //    Returns the next SQL error information.
  153.  
  154. RETCODE SQL_API SQLError(
  155.     LPENV       lpenv,
  156.     LPDBC       lpdbc,
  157.     HSTMT       hstmt,
  158.     UCHAR  FAR *szSqlState,
  159.     SDWORD FAR *pfNativeError,
  160.     UCHAR  FAR *szErrorMsg,
  161.     SWORD       cbErrorMsgMax,
  162.     SWORD  FAR *pcbErrorMsg)
  163. {
  164.     return SQL_NO_DATA_FOUND;
  165. }
  166.  
  167. //    -    -    -    -    -    -    -    -    -
  168.