C Examples: DbiGetNextRecord

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiGetNextRecord

Return to chapter overview

Retrieve the next record for the specified cursor.

In the case of local tables only, if pRecNum is not null, the corresponding record number is returned. This example uses the following input:
         fDbiGetNextRecord(hCursor, pRecBuf, &RecNum);

DBIResult fDbiGetNextRecord(hDBICur hTmpCur, pBYTE pTmpRecBuf, pUINT32 pRecNum)

{

   DBIResult      rslt;

   CURProps       CurProps;

   RECProps       RecProps;

   rslt = Chk(DbiGetNextRecord(hTmpCur, dbiNOLOCK, pTmpRecBuf, &RecProps));

   if (rslt != DBIERR_NONE)

      return rslt;

   if (pRecNum != NULL)

   {

      rslt = Chk(DbiGetCursorProps(hTmpCur, &CurProps));

      if (rslt != DBIERR_NONE)

         return rslt;

      if (strcmp(CurProps.szTableType,  szPARADOX) == 0)

         *pRecNum = RecProps.iSeqNum;

      else

      {

         if (strcmp(CurProps.szTableType,  szDBASE) ==0)

            *pRecNum = RecProps.iPhyRecNum;

         else

            *pRecNum =0;

      }

   }

   return rslt;

}