home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include "pxengine.h"
-
- #define TABLENAME "table"
-
- int main(void)
- {
- int pxErr;
- int month, day, year;
- long date;
- TABLEHANDLE tblHandle;
- RECORDHANDLE recHandle;
- FIELDHANDLE fldHandle;
-
- PXInit();
- PXTblOpen(TABLENAME, &tblHandle, 0, 0);
- PXRecBufOpen(tblHandle, &recHandle);
- PXFldHandle(tblHandle,"Date Field",&fldHandle);
- PXRecGet(tblHandle,recHandle);
- PXGetDate(recHandle, fldHandle, &date);
-
- /* Decode the date that was just retrieved. */
- if ((pxErr = PXDateDecode(date, &month, &day, &year)) != PXSUCCESS)
- printf("%s\n", PXErrMsg(pxErr));
- else
- printf("Month: %d Day: %d Year: %d\n", month, day, year);
-
- PXRecBufClose(recHandle);
- PXTblClose(tblHandle);
- PXExit();
- return(pxErr);
- }