C Examples: DbiGetRecord

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiGetRecord

Return to chapter overview

Retrieve the current record for the specified cursor.

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

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

{

   DBIResult      rslt;

   CURProps       CurProps;

   RECProps       RecProps;

   rslt = Chk(DbiGetRecord(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;

}