home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / 32SNIPIT.PAK / BLOBSMPL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  19.7 KB  |  548 lines

  1. // BDE32 3.x - (C) Copyright 1996 by Borland International
  2.  
  3. // blobsmpl.c
  4. #include "snipit.h"
  5.  
  6. #define  NAMELEN  20    // Set name length to 20 characters
  7. #define  DATELEN   9    // Set date length to 9 characters
  8.  
  9. static const char szTblName[] = "BLOBSMPL"; // Table to create
  10. static const char szTblType[] = szPARADOX;  // Table Type to use
  11.  
  12. static SNIPFAR FLDDesc fldDesc[] = {
  13.     {
  14.         1,            // Field number
  15.         "First Name", // Field name
  16.         fldZSTRING,   // Field type
  17.         fldUNKNOWN,   // Field dubtype
  18.         NAMELEN,      // Field dize ( 1 or 0,
  19.                       // except BLOB or string )
  20.         0,            // Decimal places ( 0 ) -
  21.                       //  computed
  22.         0,            // Offset in record ( 0 )"
  23.         0,            // Length in nytes  ( 0 )"
  24.         0,            // For null bits    ( 0 )"
  25.         fldvNOCHECKS, // Validity checks   ( 0 )"
  26.         fldrREADWRITE // Rights                "
  27.     },
  28.     {
  29.         2, "Middle Name", fldZSTRING, fldUNKNOWN,
  30.         NAMELEN, 0, 0, 0, 0,
  31.         fldvNOCHECKS, fldrREADWRITE
  32.     },
  33.     {
  34.         3, "Last Name", fldZSTRING, fldUNKNOWN,
  35.         NAMELEN, 0, 0, 0, 0,
  36.         fldvNOCHECKS, fldrREADWRITE
  37.     },
  38.     {
  39.         4, "DOB", fldDATE, fldUNKNOWN,
  40.         0, 0, 0, 0, 0,
  41.         fldvNOCHECKS, fldrREADWRITE
  42.     },
  43.     {
  44.         5, "POB", fldZSTRING, fldUNKNOWN,
  45.         20, 0, 0, 0, 0,
  46.         fldvNOCHECKS, fldrREADWRITE
  47.     },
  48.     { // Note that Memo fields in PARADOX require a
  49.       // size - this is the amount of the BLOB which
  50.       // is stored within the actual table as well
  51.       // as being stored in the .MB file.
  52.       6, "General Info", fldBLOB, fldstMEMO,
  53.       20, 0, 0, 0, 0,
  54.       fldvNOCHECKS, fldrREADWRITE
  55.     }};  // Array of field descriptors
  56.  
  57. static SNIPFAR IDXDesc idxDesc[] = {
  58.     { // Primary Index
  59.         "Full Name",  // Name
  60.         1,            // Number
  61.         { NULL },     // Tag Name ( for dBase )
  62.         { NULL },     // Optional Format ( BTREE,
  63.                       // HASH, etc )
  64.         TRUE,         // Primary?
  65.         TRUE,         // Unique?
  66.         FALSE,        // Descending?
  67.         TRUE,         // Maintained?
  68.         FALSE,        // SubSet?
  69.         FALSE,        // Expression index?
  70.         NULL,         // for QBE only
  71.         3,            // Fields in key
  72.         1,            // Length in bytes
  73.         FALSE,        // Index out of date?
  74.         0,            // Key Type of Expression
  75.         { 1,2,3 },    // Array of field numbers
  76.         { 0 },        // Key expression
  77.         { 0 },        // Key Condition
  78.         FALSE,        // Case insensitive
  79.         0,            // Block size in bytes
  80.         0
  81.     }};  // Array of index descriptors
  82.  
  83. // Number of fields in the table
  84. const UINT16 uNumFields = sizeof(fldDesc) / sizeof (fldDesc[0]);
  85.  
  86. // Number of indexes in the table
  87. const UINT16 uNumIndexes = sizeof(idxDesc) / sizeof(idxDesc[0]);
  88.  
  89. void        FillFullRecord(hDBICur, pBYTE);
  90. void        FillHalfRecord(hDBICur, pBYTE);
  91. DBIResult   FillFields(hDBICur hCur, pCHAR pszFNAME, pCHAR pszMNAME,
  92.                        pCHAR pszLNAME, UINT16 uMonth, UINT16 uDay,
  93.                        UINT16 uYear, pCHAR pszPOB, pBYTE pRecBuf);
  94. void        FillString(pCHAR pString);
  95. void        FillHalfString(pCHAR pString);
  96. void        DispBlob(hDBICur hCur, pBYTE pRecBuf);
  97.  
  98. //=====================================================================
  99. //  Function:
  100. //          SimpleBlobIO();
  101. //
  102. //  Description:
  103. //          This example shows how to read and write BLOBs.  This example
  104. //          will cover how to access entire BLOB information and sections
  105. //          of a BLOB.
  106. //=====================================================================
  107. void
  108. SimpleBlobIO (void)
  109. {
  110.     hDBIDb      hDb = 0;            // Handle to the database
  111.     hDBICur     hCur = 0;           // Handle to the table
  112.     DBIResult   rslt;               // Value returned from IDAPI functions
  113.     CURProps    TblProps;           // Table properties
  114.     pBYTE       pRecBuf;            // Pointer to the record buffer
  115.     CRTblDesc   crTblDsc;           // Create Table descriptor
  116.     BOOL        bOverWrite = TRUE;  // Overwrite, yes/no flag
  117.  
  118.     Screen("*** Simple BLOB I/O Example ***\r\n");
  119.  
  120.     BREAK_IN_DEBUGGER();
  121.  
  122.     Screen("    Initializing IDAPI...");
  123.     if (InitAndConnect(&hDb) != DBIERR_NONE)
  124.     {
  125.         Screen("\r\n*** End of Example ***");
  126.         return;
  127.     }
  128.  
  129.     Screen("    Setting the database directory...");
  130.     rslt = DbiSetDirectory(hDb, (pCHAR) szTblDirectory);
  131.     ChkRslt(rslt, "SetDirectory");
  132.  
  133.     // Clear the buffer.
  134.     memset(&crTblDsc,0, sizeof(CRTblDesc));
  135.  
  136.     // Set the name and type of the table
  137.     strcpy(crTblDsc.szTblName, szTblName) ;
  138.     strcpy(crTblDsc.szTblType, szTblType) ;
  139.  
  140.     // Set the number of fields and the field descriptor
  141.     crTblDsc.iFldCount     = uNumFields ;
  142.     crTblDsc.pfldDesc      = fldDesc ;
  143.  
  144.     // Set the number of indexes and teh index descriptor
  145.     crTblDsc.iIdxCount     = uNumIndexes ;
  146.     crTblDsc.pidxDesc      = idxDesc ;      
  147.  
  148.     Screen("    Create the %s table...", szTblName);
  149.     rslt = DbiCreateTable(hDb, bOverWrite, &crTblDsc);
  150.     if (ChkRslt(rslt, "CreateTable") != DBIERR_NONE)
  151.     {
  152.         CloseDbAndExit(&hDb);
  153.         Screen("\r\n*** End of Example ***");
  154.         return;
  155.     }
  156.  
  157.     rslt = DbiOpenTable(hDb,(pCHAR) szTblName,(pCHAR) szTblType,
  158.                         NULL, NULL, 0, dbiREADWRITE, dbiOPENSHARED,
  159.                         xltFIELD, FALSE, NULL, &hCur);
  160.     if (ChkRslt(rslt, "OpenTable") != DBIERR_NONE)
  161.     {
  162.         CloseDbAndExit(&hDb);
  163.         Screen("\r\n*** End of Example ***");
  164.         return;
  165.     }
  166.  
  167.     // Get the properties in order to determine the size of the record
  168.     rslt = DbiGetCursorProps(hCur, &TblProps);
  169.     ChkRslt(rslt, "GetCursorProps");
  170.  
  171.     // Allocate memory for the record buffer
  172.     pRecBuf  = (pBYTE)malloc(TblProps.iRecBufSize * sizeof(BYTE));
  173.  
  174.     // Fill the database with a string set in the FillRecord
  175.     // function.
  176.     FillFullRecord(hCur, pRecBuf);
  177.  
  178.     // Display the BLOB
  179.     Screen("\r\n    This is the BLOB information in Record #1\r\n");
  180.     DispBlob(hCur, pRecBuf);
  181.  
  182.     // Create another record and fill it with the same
  183.     // data.  However, change the BLOB info with DbiPutBlob.
  184.     FillHalfRecord(hCur, pRecBuf);
  185.  
  186.     // Display the BLOB
  187.     Screen("\r\n    This is the BLOB information in Record #2\r\n");
  188.     DispBlob(hCur, pRecBuf);
  189.  
  190.     // Cleanup
  191.  
  192.     free(pRecBuf);
  193.  
  194.     Screen("\r\n    Close the %s table...", szTblName);
  195.     rslt = DbiCloseCursor(&hCur);
  196.     ChkRslt(rslt, "CloseCursor");
  197.  
  198.     Screen("    Delete the %s table...", szTblName);
  199.     rslt = DbiDeleteTable(hDb, (pCHAR) szTblName, (pCHAR) szTblType);
  200.     ChkRslt(rslt, "DeleteTable");
  201.  
  202.     Screen("    Close the database and exit IDAPI...");
  203.     CloseDbAndExit(&hDb);
  204.  
  205.     Screen("\r\n*** End of Example ***");
  206. }
  207.  
  208. //=====================================================================
  209. //  Function:
  210. //          FillFullRecord();
  211. //
  212. //  Input:  Cursor to Table (hDBICur), Record Buffer (pBYTE).
  213. //
  214. //  Return: Dbi Result.
  215. //
  216. //  Desc:   This function simply takes the cursor and fills the record
  217. //          buffer with pre-assigned values (static values for this
  218. //          example).  It returns an error if we encounter one.
  219. //          This function makes the code a bit more readable.
  220. //=====================================================================
  221. void
  222. FillFullRecord (hDBICur hCur, pBYTE pRecBuf)
  223. {
  224.     pCHAR       pGenInfo;   // Buffer to contain the string which is
  225.                             // written to the BLOB field
  226.     DBIResult   rslt;       // Return value from Engine functions
  227.  
  228.     // Initialize the record buffer before filling it
  229.     rslt = DbiInitRecord(hCur, pRecBuf);
  230.     ChkRslt(rslt, "InitRecord");
  231.  
  232.     // Allocate a buffer that is capable of holding a large string.
  233.     pGenInfo = (pCHAR) malloc(sizeof (CHAR) * 1200);
  234.     if (pGenInfo == NULL)
  235.     {
  236.         return;
  237.     }
  238.  
  239.     // Function will fill the pGeninfo pointer with a string
  240.     // that is larger than 256 bytes.
  241.     FillString(pGenInfo);
  242.  
  243.     // Fill the fields of the buffer. The fields are filled directly,
  244.     // but a variable could be used that would hold the string, date or
  245.     // BLOB information.
  246.     FillFields (hCur, "Charlie", "L", "Carm", 12, 24, 55, "New York", pRecBuf);
  247.  
  248.     // Open the BLOB.  To write or read from a BLOB you MUST open the
  249.     // BLOB first.  All that is needed is the cursor, the Record buffer,
  250.     // the field number and the rights.  If the BLOB is opened in
  251.     // ReadWrite mode, the table MUST be opened in ReadWrite mode also.
  252.     rslt = DbiOpenBlob(hCur, pRecBuf, 6, dbiREADWRITE);
  253.     ChkRslt(rslt, "OpenBlob");
  254.  
  255.     // Put the whole BLOB into the field
  256.     rslt = DbiPutBlob(hCur, pRecBuf, 6, 0, (strlen(pGenInfo) + 1),
  257.                       (pBYTE) pGenInfo);
  258.     ChkRslt(rslt, "PutBlob");
  259.  
  260.     // Append a record to the table.
  261.     rslt = DbiAppendRecord(hCur, pRecBuf);
  262.     ChkRslt(rslt, "AppendRecord");
  263.  
  264.     free(pGenInfo);
  265.  
  266.     rslt = DbiFreeBlob(hCur, pRecBuf, 6);
  267.     ChkRslt(rslt, "FreeBlob");
  268. }
  269.  
  270. //=====================================================================
  271. //  Function:
  272. //          FillHalfRecord();
  273. //
  274. //  Input:  Cursor to Table (hDBICur), Record Buffer (pBYTE).
  275. //
  276. //  Return: Dbi Result.
  277. //
  278. //  Desc:   This function simply takes the cursor and fills the record
  279. //          buffer with pre-assigned values (static values for this
  280. //          example).  It returns an error if we encounter one.
  281. //          This function makes the code a bit more readable.
  282. //=====================================================================
  283. void
  284. FillHalfRecord (hDBICur hCur, pBYTE pRecBuf)
  285. {
  286.     pCHAR       pGenInfo;   // Buffer to contain the string which is
  287.                             // written to the BLOB field
  288.     UINT16      GenLen;     // Length of the string
  289.     DBIResult   rslt;
  290.  
  291.     // Initialize the record buffer before filling it
  292.     rslt = DbiInitRecord(hCur, pRecBuf);
  293.     ChkRslt(rslt, "InitRecord");
  294.  
  295.     // Allocate a buffer that is capable of holding a large string.
  296.     pGenInfo = (pCHAR) malloc(sizeof (CHAR) * 1200);
  297.     if (pGenInfo == NULL)
  298.     {
  299.         return;
  300.     }
  301.  
  302.     // Function will fill the pGeninfo pointer with a string
  303.     // that is larger than 256 bytes.
  304.     FillString(pGenInfo);
  305.  
  306.     // Fill the fields of the buffer. The fields are filled directly,
  307.     // but a variable could be used that would hold the string, date or
  308.     // BLOB information.
  309.     FillFields (hCur, "Ronald", "P", "Halter", 8, 15, 70, "Chicago", pRecBuf);
  310.  
  311.     // Open the BLOB.  To write or read from a BLOB you MUST open the
  312.     // BLOB first.  All that is needed is the cursor, the record buffer,
  313.     // the field number and the rights.  If the BLOB is opened in
  314.     // ReadWrite mode, the table must be opened in ReadWrite mode also.
  315.     rslt = DbiOpenBlob(hCur, pRecBuf, 6, dbiREADWRITE);
  316.     ChkRslt(rslt, "OpenBlob");
  317.  
  318.     // Put the whole BLOB into the field
  319.     rslt = DbiPutBlob(hCur, pRecBuf, 6, 0, (strlen(pGenInfo) + 1),
  320.                       (pBYTE) pGenInfo);
  321.     ChkRslt(rslt, "PutBlob");
  322.  
  323.     // Get the length of the present BLOB information before changing
  324.     // it.
  325.     GenLen = (UINT16)strlen(pGenInfo);
  326.  
  327.     // Clear the pGenINfo Buffer.
  328.     memset(pGenInfo,0, sizeof(pGenInfo));
  329.  
  330.     // Fill the pGenInfo buffer with a new string.
  331.     FillHalfString(pGenInfo);
  332.  
  333.     // Change half of the present BLOB value by
  334.     // putting a new string in the second half of the BLOB.
  335.     // Use the length of the originally inserted BLOB divided
  336.     // by two to find the halfway point and add one to compensate
  337.     // for the odd length.
  338.     rslt = DbiPutBlob(hCur, pRecBuf, 6, (GenLen/2), strlen(pGenInfo),
  339.                       (pBYTE) pGenInfo);
  340.     ChkRslt(rslt, "PutBlob");
  341.  
  342.     // Append a record to the table.
  343.     rslt = DbiAppendRecord(hCur, pRecBuf);
  344.     ChkRslt(rslt, "AppendRecord");
  345.  
  346.     // Free the general info buffer from the program's memory.
  347.     free(pGenInfo);
  348.  
  349.     // Free the BLOB.
  350.     rslt = DbiFreeBlob(hCur, pRecBuf, 6);
  351.     ChkRslt(rslt, "FreeBlob");
  352. }
  353.  
  354. //=====================================================================
  355. //  Function:
  356. //          FillString();
  357. //
  358. //  Input:  pString -   A string buffer that will be written into by the
  359. //                      function.
  360. //
  361. //  Return: None.  (The input string is modified.)
  362. //
  363. //  Desc:   This example fills the input string with a preset string, 
  364. //          which is larger than 256 bytes.
  365. //=====================================================================
  366. void
  367. FillString (pCHAR pString)
  368. {
  369.     strcpy(pString,
  370.            "        This is a test of the BLOB functions.  The power of "
  371.            "a BLOB is that it can contain anything.\r\n"
  372.            "        This is a test of the BLOB functions.  The power of "
  373.            "a BLOB is that it can contain anything.\r\n"
  374.            "        This is a test of the BLOB functions.  The power of "
  375.            "a BLOB is that it can contain anything.\r\n"
  376.            "        This is a test of the BLOB functions.  The power of "
  377.            "a BLOB is that it can contain anything.\r\n"
  378.            "        This is a test of the BLOB functions.  The power of "
  379.            "a BLOB is that it can contain anything.\r\n"
  380.            "        This is a test of the BLOB functions.  The power of "
  381.            "a BLOB is that it can contain anything.\r\n"
  382.            "        This is a test of the BLOB functions.  The power of "
  383.            "a BLOB is that it can contain anything.\r\n"
  384.            "        This is a test of the BLOB functions.  The power of "
  385.            "a BLOB is that it can contain anything.\r\n");
  386. }
  387.  
  388. //=====================================================================
  389. //  Function:
  390. //          FillHalfString();
  391. //
  392. //  Input:  pString -   A string buffer that will be written into by the
  393. //                      function.
  394. //
  395. //  Return: None.  (The input string is modified.)
  396. //
  397. //  Desc:   This example fills the input string with a preset string, 
  398. //          which is larger than 256 bytes.  The string used is different
  399. //          from the one used in FillString().
  400. //=====================================================================  
  401. void
  402. FillHalfString (pCHAR pString)
  403. {
  404.     strcpy(pString,
  405.            "        This is line 1 of the BLOB functions.  The power of a"
  406.            " BLOB is that it is dynamic and quick.\r\n"
  407.            "        This is line 2 of the BLOB functions.  The power of a"
  408.            " BLOB is that it is dynamic and quick.\r\n"
  409.            "        This is line 3 of the BLOB functions.  The power of a"
  410.            " BLOB is that it is dynamic and quick.\r\n"
  411.            "        This is line 4 of the BLOB functions.  The power of a"
  412.            " BLOB is that it is dynamic and quick.\r\n");
  413. }
  414.  
  415. //=====================================================================
  416. //  Function:
  417. //          DispBlob();
  418. //
  419. //  Input:  hCur    -   Table Cursor.
  420. //          pRecBuf -   Record Buffer.
  421. //          iOff    -   Which record to display.
  422. //
  423. //  Return: None.
  424. //
  425. //  Desc:   This function displays the BLOB field that is pointed to by
  426. //          the cursor and which resides in the record buffer.  The
  427. //          function displays the whole BLOB and then half of the BLOB.
  428. //          It uses DbiGetBlob with and without a range to accomplish
  429. //          this.
  430. //=====================================================================
  431. void
  432. DispBlob (hDBICur hCur, pBYTE pRecBuf)
  433. {
  434.     UINT32      BlobSize;           // Size of the BLOB
  435.     UINT32      ActualSize;         // Actual size of the BLOB as read
  436.                                     //  from the table
  437.     pBYTE       phBlob;             // Pointer to BLOB data
  438.     pBYTE       phHalfBlob;         // Pointer to BLOB data
  439.     DBIResult   rslt;               // Return value from Engine functions.
  440.  
  441.     memset(pRecBuf,0, sizeof(pRecBuf)); // Clear the record buffer.
  442.  
  443.     // Get the record from the table
  444.     rslt = DbiGetRecord(hCur, dbiWRITELOCK, pRecBuf, 0);
  445.     ChkRslt(rslt, "GetRecord");
  446.  
  447.     // Open the BLOB.  The BLOB must be opened before reading from 
  448.     // or writing to it.  
  449.     // This part locks the record in the previous function DbiGetRecord
  450.     // with the WRITELOCK option.  No lock on the BLOB is needed as the 
  451.     // BLOB will not be modified.
  452.     rslt = DbiOpenBlob(hCur, pRecBuf, 6, dbiREADONLY);
  453.     ChkRslt(rslt, "OpenBlob");
  454.  
  455.     // Now get the size of the BLOB
  456.     rslt = DbiGetBlobSize(hCur, pRecBuf, 6, &BlobSize);
  457.     ChkRslt(rslt, "GetBlobSize");
  458.  
  459.     // Allocate the memory for the BLOB buffer.
  460.     phBlob  = (pBYTE)malloc( sizeof(BYTE) * (UINT16)BlobSize);
  461.  
  462.     // Allocate memory for the pHalfBlob buffer
  463.     phHalfBlob  = (pBYTE)malloc(((sizeof(BYTE) * (UINT16)BlobSize)/2)+2);
  464.  
  465.     // Initialize the buffers to 0.  Cast the Blobsize to UINT16 because
  466.     // the memset function expects a UINT16. (Assume for the example that
  467.     // the BLOB is less than 64K in size.
  468.     memset(phBlob, 0, (UINT16)BlobSize);
  469.     memset(phHalfBlob, 0, ((UINT16)BlobSize/2)+ 2);
  470.  
  471.     // Get the BLOB from the table.
  472.     rslt = DbiGetBlob(hCur, pRecBuf, 6, 0, BlobSize, phBlob, &ActualSize);
  473.     ChkRslt(rslt, "GetBlob");
  474.  
  475.     Screen("    This is the WHOLE BLOB Field\r\n");
  476.     Screen((pCHAR)phBlob);
  477.  
  478.     // Now we are going to get half the BLOB and display that.  To get
  479.     // half the BLOB we start at half the total size BlobSize/2 and
  480.     // retrieve BlobSize/2 bytes.
  481.     rslt = DbiGetBlob(hCur, pRecBuf, 6, ((BlobSize) / 2), ((BlobSize) / 2),
  482.                       phHalfBlob, &ActualSize);
  483.     ChkRslt(rslt, "GetBlob");
  484.  
  485.     // Display the BLOB.
  486.     Screen("    This is HALF of the BLOB Field\r\n");
  487.     Screen((pCHAR)phHalfBlob);
  488.  
  489.     // Free the BLOB from memory.
  490.     rslt = DbiFreeBlob(hCur, pRecBuf, 6);
  491.     ChkRslt(rslt, "FreeBlob");
  492.  
  493.     free(phBlob);     // Free the BLOB buffer form the program's memory.
  494.     free(phHalfBlob); // Free the half BLOB buffer from the program's
  495.                       // memory.
  496. }
  497.  
  498. //=====================================================================
  499. //  Function:
  500. //          FillRecord();
  501. //
  502. //  Input:  pointer to the cursor handle, First Name(pCHAR), Middle Name(pCHAR),
  503. //          Last Name(pCHAR), Month (UINT16), Day (UINT16), Year (UINT16),
  504. //          Place of birth(pCHAR), record buffer (pBYTE).
  505. //
  506. //  Return: Result of adding the fields to the record buffer.
  507. //
  508. //  Description:
  509. //          This function will add a some data into a pre-existing
  510. //          record buffer.
  511. //=====================================================================
  512. DBIResult
  513. FillFields (hDBICur hCur, pCHAR pszFNAME, pCHAR pszMNAME, pCHAR pszLNAME,
  514.             UINT16 uMonth, UINT16 uDay, UINT16 uYear, pCHAR pszPOB,
  515.             pBYTE pRecBuf)
  516. {
  517.     DBIDATE     dDate;
  518.     DBIResult   rslt;
  519.  
  520.     // First Name
  521.     rslt = DbiPutField(hCur, 1, pRecBuf, (pBYTE) pszFNAME);
  522.     ChkRslt(rslt, "PutField");
  523.  
  524.     // Middle Name
  525.     rslt = DbiPutField(hCur, 2,  pRecBuf, (pBYTE) pszMNAME);
  526.     ChkRslt(rslt, "PutField");
  527.  
  528.     // Last Name
  529.     rslt = DbiPutField(hCur, 3,  pRecBuf, (pBYTE) pszLNAME);
  530.     ChkRslt(rslt, "PutField");
  531.  
  532.     // Date of Birth
  533.     rslt = DbiDateEncode(uMonth, uDay, uYear, &dDate);
  534.     ChkRslt(rslt, "DateEncode");
  535.  
  536.     // If the date is legal we add it to
  537.     // the fourth field in the record. (DOB)
  538.     rslt = DbiPutField(hCur, 4, pRecBuf, (pBYTE)&dDate);
  539.     ChkRslt(rslt, "PutField");
  540.  
  541.     // Place of Birth
  542.     rslt = DbiPutField(hCur, 5,  pRecBuf, (pBYTE) pszPOB);
  543.     ChkRslt(rslt, "PutField");
  544.  
  545.     return DBIERR_NONE;
  546. }
  547.  
  548.