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