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

  1. #include <stdio.h>
  2. #include "pxengine.h"
  3.  
  4. #define NETDIR          ""
  5. #define NETTYPE         NOTONNET
  6. #define PASSWORD        "password"
  7. #define TABLENAME       "table"
  8.  
  9. int main(void)
  10. {
  11.     int pxErr;
  12.     int Protected;
  13.  
  14.     PXNetInit(NETDIR,NOTONNET,DEFUSERNAME);
  15.     PXTblProtected(TABLENAME, &Protected);
  16.  
  17.     if (Protected) 
  18.     {
  19.         /* Submit password to system if table protected */
  20.         if ((pxErr = PXPswAdd(PASSWORD)) != PXSUCCESS)
  21.             printf("%s\n", PXErrMsg(pxErr));
  22.     }
  23.  
  24.     PXExit();
  25.     return(pxErr);
  26. }
  27.