home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include "pxengine.h"
-
- #define TABLENAME "table"
-
- int main(void)
- {
- TABLEHANDLE tblHandle;
- RECORDHANDLE recHandle;
- FIELDHANDLE fldHandle;
- long date;
- int month = 12, day = 5, year = 1989;
- int pxErr;
-
- PXInit();
- PXTblOpen(TABLENAME, &tblHandle, 0, 0);
- PXRecBufOpen(tblHandle, &recHandle);
- PXFldHandle(tblHandle, "Date Field", &fldHandle);
- PXDateEncode(month, day, year, &date);
-
- /* Update record with new date */
- if ((pxErr = PXPutDate(recHandle, fldHandle, date))
- != PXSUCCESS)
- printf("%s\n", PXErrMsg(pxErr));
- else
- PXRecUpdate(tblHandle, recHandle);
-
- PXRecBufClose(recHandle);
- PXTblClose(tblHandle);
- PXExit();
- return(pxErr);
- }