C Examples: DbiGetRelativeRecord

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiGetRelativeRecord

Return to chapter overview

Retrieve the relative record for the specified cursor.

For local tables only, if pRecNum is not null, the corresponding record number is returned. This example use the following input:
         fDbiGetRelativeRecord(hPXCur, 10, pPXRecBuf, &FldNum);

 

DBIResult fDbiGetRelativeRecord(hDBICur hTmpCur, INT32 iOffset, pBYTE pTmpRecBuf, pUINT32 pRecNum)

{

   DBIResult      rslt;

   CURProps       CurProps;

   RECProps       RecProps;

   rslt = Chk(DbiGetRelativeRecord(hTmpCur, iOffset, 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;

}