C Examples: DbiGetPriorRecord

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiGetPriorRecord

Return to chapter overview

Retrieve the prior 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:
         fDbiGetPriorRecord(hCursor, pRecBuf, &RecNum);

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

{

  DBIResult      rslt;

  CURProps       CurProps;

  RECProps       RecProps;

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

}