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

  1. /*
  2. ** INFO.C - This is the ODBC sample driver code for
  3. ** executing information functions.
  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 <memory.h>
  13. #include "sample.h"
  14.  
  15. //    -    -    -    -    -    -    -    -    -
  16.  
  17. RETCODE SQL_API SQLGetInfo(
  18.     HDBC      hdbc,
  19.     UWORD     fInfoType,
  20.     PTR       rgbInfoValue,
  21.     SWORD     cbInfoValueMax,
  22.     SWORD FAR *pcbInfoValue)
  23. {
  24.     if (fInfoType == SQL_MAX_USER_NAME_LEN)
  25.         *(UNALIGNED SWORD FAR *)rgbInfoValue = 0;
  26.     else if (fInfoType == SQL_DRIVER_ODBC_VER)
  27.         lstrcpy (rgbInfoValue, SQL_SPEC_STRING);
  28.     return SQL_SUCCESS;
  29. }
  30.  
  31. //    -    -    -    -    -    -    -    -    -
  32.  
  33. RETCODE SQL_API SQLGetTypeInfo(
  34.     HSTMT    hstmt,
  35.     SWORD    fSqlType)
  36. {
  37.     return SQL_SUCCESS;
  38. }
  39.  
  40. //    -    -    -    -    -    -    -    -    -
  41.  
  42. RETCODE SQL_API SQLGetFunctions(
  43.     LPDBC     lpdbc,
  44.     UWORD     fFunction,
  45.     UWORD FAR *pfExists)
  46. {
  47.     if (fFunction == SQL_API_ALL_FUNCTIONS)
  48.     {
  49.         int i;
  50.  
  51.         memset (pfExists, 0, sizeof(UWORD)*100);
  52.         for (i = SQL_API_SQLALLOCCONNECT; i <= SQL_NUM_FUNCTIONS; i++)
  53.             pfExists[i] = TRUE;
  54.         for (i = SQL_EXT_API_START; i <= SQL_EXT_API_LAST; i++)
  55.             pfExists[i] = TRUE;
  56.     }
  57.     else
  58.         *pfExists = TRUE;
  59.     return SQL_SUCCESS;
  60. }
  61.