C Examples: DbiGetRecordForKey

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiGetRecordForKey

Return to chapter overview

Position the cursor and return the record buffer containing the specified key

This examples works with the STOCK.DB table and uses the following input:
         fDbiGetRecordForKey(hCur, pRecBuf);

 

DBIResult fDbiGetRecordForKey(hDBICur hTmpCur, pBYTE pTmpRecBuf)

{

   DBIResult   rslt;

   DFLOAT      key = 1330.00;

   rslt = Chk(DbiInitRecord(hTmpCur, pTmpRecBuf));

   if (rslt != DBIERR_NONE)

      return rslt;

   rslt = Chk(DbiPutField(hTmpCur, 1, pTmpRecBuf, (pBYTE)&key));

   if (rslt != DBIERR_NONE)

      return rslt;

   rslt = Chk(DbiGetRecordForKey(hTmpCur, FALSE, 0, 0, pTmpRecBuf, pTmpRecBuf));

   return rslt;

}