home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 for Intel / NeXTSTEP 3.2 for Intel.iso / NextLibrary / Documentation / Sybase / DBLIB / Section2 / dberrhandle.ex < prev    next >
Encoding:
Text File  |  1993-04-22  |  522 b   |  25 lines

  1. #include <sybfront.h>
  2. #include <sybdb.h>
  3. #include <syberror.h>
  4.  
  5. int err_handler(dbproc, severity, dberr, oserr, dberrstr, oserrstr)
  6. DBPROCESS       *dbproc;
  7. int             severity;
  8. int             dberr;
  9. int             oserr;
  10. char            *dberrstr;
  11. char            *oserrstr;
  12. {
  13.     if ((dbproc == NULL) || (DBDEAD(dbproc)))
  14.         return(INT_EXIT);
  15.     else 
  16.     {
  17.         printf("DB-Library error:\en\et%s\en", dberrstr);
  18.  
  19.         if (oserr != DBNOERR)
  20.             printf("Operating-system error:\en\et%s\en", oserrstr);
  21.  
  22.         return(INT_CANCEL);
  23.     }
  24. }
  25.