home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a006 / 2.ddi / CEXAM.ZIP / FLDNAME.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-11  |  616 b   |  28 lines

  1. #include <stdio.h>
  2. #include "pxengine.h"
  3.  
  4. #define TABLENAME        "table"
  5.  
  6. int main(void)
  7. {
  8.     TABLEHANDLE tblHandle;
  9.     FIELDHANDLE fldHandle = 1;
  10.     char fldName[BUFSIZ];
  11.     int pxErr;
  12.  
  13.     PXInit();
  14.     PXTblOpen(TABLENAME, &tblHandle, 0, 0);
  15.  
  16.     /* Get field name for first field in table */
  17.     if ((pxErr = PXFldName(tblHandle, fldHandle, BUFSIZ, fldName))
  18.     != PXSUCCESS)
  19.         printf("%s\n", PXErrMsg(pxErr));
  20.     else
  21.         printf("Field handle %d has field name %s\n", 
  22.             fldHandle, fldName);
  23.  
  24.     PXTblClose(tblHandle);
  25.     PXExit();
  26.     return(pxErr);
  27. }
  28.