C Examples: DbiGetRintDesc

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiGetRintDesc

Return to chapter overview

Get the first referential integrity constraint for the specified cursor.

If RIDesc is not null, a string is also formulated with RI information.This example uses the following input:
         fDbiGetRintDesc(hCur, &RintDesc, Buffer);

DBIResult fDbiGetRintDesc(hDBICur hTmpCur, pRINTDesc pRintDesc, pCHAR RIDesc)

{

   DBIResult   rslt;

   CURProps    CurProps;

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

   if(CurProps.iRefIntChecks > 0)

   {

      rslt = Chk(DbiGetRintDesc(hTmpCur, 1, pRintDesc));

      if (rslt != DBIERR_NONE)

         return rslt;

      if (RIDesc != NULL)

        wsprintf(RIDesc, "RI Number: %i, IR Name: %s, RI Tbl Name: %s, RI Fields: %d",

                   pRintDesc->iRintNum, pRintDesc->szRintName, pRintDesc->szTblName,

                   pRintDesc->iFldCount);

   }

   else

      MessageBox(0, "No Referential Integrity Links", "Warning", MB_OK);

   return rslt;

}