C Examples: DbiOpenRintList

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiOpenRintList

Return to chapter overview

Creates a string containing all the names of referential integrity constraints on the specified table.

This example uses the following inputs:
         fDbiOpenRintList(hDb, "ORDERS.DB", Buffer);

DBIResult fDbiOpenRintList(hDBIDb hDb, pCHAR TblName, pCHAR RIntList)

{

   DBIResult      rslt;

   hDBICur        hTmpCur = 0;

   RINTDesc       RIDesc;

   RIntList[0] = '\0';

   rslt = Chk(DbiOpenRintList(hDb, TblName, szPARADOX, &hTmpCur));

   if (rslt == DBIERR_NONE)

   {

      while (DbiGetNextRecord(hTmpCur, dbiNOLOCK, (pBYTE)&RIDesc, NULL) == DBIERR_NONE)

      {

         strcat(RIntList, RIDesc.szRintName);

         strcat(RIntList, "  ");

      }

   }

   return rslt;

}