C Examples: DbiGetFieldTypeDesc

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

C Examples: DbiGetFieldTypeDesc

Return to chapter overview

Obtain the descriptor for a possible field type.

DBIResult fDbiGetFieldTypeDesc(hDBICur hTmpCur)

{

   DBIResult      rslt;

   hDBICur        hTmpListCur;

   FLDType        fldType;

   FLDDesc        fldDesc;

   TBLType        tblType;

   pCHAR          DrvType = szPARADOX;

   pCHAR          info;

   rslt = Chk(DbiOpenTableTypesList(DrvType, &hTmpListCur));

   rslt = DbiSetToBegin(hTmpListCur);

   rslt = Chk(DbiGetNextRecord(hTmpListCur, dbiNOLOCK,

                              (pBYTE)&tblType, NULL));

   info = (pCHAR)malloc(DBIMAXMSGLEN);

   rslt = Chk(DbiSetToBegin(hTmpCur));

   rslt = Chk(DbiGetNextRecord(hTmpCur, dbiNOLOCK,

                              (pBYTE)&fldDesc, NULL));

   rslt = Chk(DbiGetFieldTypeDesc(DrvType, (pCHAR)tblType.szName,

                                  (pCHAR)fldDesc.szName, &fldType));

   info[0] = '\0';

   strcat(info, "\r\n\r\n");

   strcat(info, tblType.szName);

   strcat(info, ":\r\n");

   strcat(info, fldType.szName);

   strcat(info, ": ");

   strcat(info, fldType.szText);

   return rslt;

}