/[LeafOK_CVS]/innwebd/base.cpp
ViewVC logotype

Diff of /innwebd/base.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.14 by sysadm, Fri May 20 14:31:54 2005 UTC Revision 1.15 by sysadm, Fri Apr 11 17:14:49 2008 UTC
# Line 1  Line 1 
1  /*******************************************************/  /*******************************************************/
2  /*                                                     */  /*                                                     */
3  /*  LeafOK Innbbsd                                     */  /*  LeafOK Innbbsd                                     */
 /*  Copyright (C) LeafOK.com, 2003-2005                */  
4  /*                                                     */  /*                                                     */
5  /*  Programmed by Leaf                                 */  /*  Copyright (C) LeafOK.com, 2003-2008                */
 /*  E-mail:leaflet@leafok.com  QQ:6049044              */  
6  /*                                                     */  /*                                                     */
7  /*  http://bbs.leafok.com                              */  /*  http://www.leafok.com                              */
 /*  http://bbs.leafok.net                              */  
 /*  http://bbs.fenglin.info                            */  
8  /*                                                     */  /*                                                     */
9  /*******************************************************/  /*******************************************************/
10    
# Line 46  int base::s_exec(const char* in_str, CSt Line 42  int base::s_exec(const char* in_str, CSt
42          }          }
43          catch(CException* e)          catch(CException* e)
44          {          {
45                  syslog << logfile::log_head << "Error in s_exec()" << endl;                  char strErrMsg[1024];
46                    e->GetErrorMessage(strErrMsg,1024);
47                    syslog << logfile::log_head << "Error in s_exec() [" << strErrMsg << "]" << endl;
48                  e->Delete();                  e->Delete();
49                  return -1;                  return -1;
50          }          }
# Line 59  int base::db_open(const char* conn_str) Line 57  int base::db_open(const char* conn_str)
57          try          try
58          {          {
59                  this->Db.Open("",0,0,conn_str,0);                  this->Db.Open("",0,0,conn_str,0);
60                    this->Db.ExecuteSQL("SET CHARACTER SET gb2312");
61                    this->Db.ExecuteSQL("SET NAMES 'gb2312'");
62          }          }
63          catch(CException* e)          catch(CException* e)
64          {          {
65                  syslog << logfile::log_head << "Open database failed in db_open()" << endl;                  char strErrMsg[1024];
66                    e->GetErrorMessage(strErrMsg,1024);
67                    syslog << logfile::log_head << "Open database failed in db_open() [" << strErrMsg << "]" << endl;
68                  e->Delete();                  e->Delete();
69                  return -1;                  return -1;
70          }          }
# Line 78  int base::db_close(void) Line 80  int base::db_close(void)
80          }          }
81          catch(CException* e)          catch(CException* e)
82          {          {
83                  syslog << logfile::log_head << "Close database failed in db_close()" << endl;                  char strErrMsg[1024];
84                    e->GetErrorMessage(strErrMsg,1024);
85                    syslog << logfile::log_head << "Close database failed in db_close() [" << strErrMsg << "]" << endl;
86                  e->Delete();                  e->Delete();
87                  return -1;                  return -1;
88          }          }
# Line 351  long base::last_insert_id(void) Line 355  long base::last_insert_id(void)
355          }          }
356          catch(CException* e)          catch(CException* e)
357          {          {
358                  syslog << logfile::log_head << "Error in last_insert_id()" << endl;                  char strErrMsg[1024];
359                    e->GetErrorMessage(strErrMsg,1024);
360                    syslog << logfile::log_head << "Error in last_insert_id() [" << strErrMsg << "]" << endl;
361                  e->Delete();                  e->Delete();
362                  return 0;                  return 0;
363          }          }
# Line 425  int base::s_send(const char* in_str, boo Line 431  int base::s_send(const char* in_str, boo
431          }          }
432          catch(CException* e)          catch(CException* e)
433          {          {
434                  syslog << logfile::log_head << "Error in s_send()" << endl;                  char strErrMsg[1024];
435                    e->GetErrorMessage(strErrMsg,1024);
436                    syslog << logfile::log_head << "Error in s_send() [" << strErrMsg << "]" << endl;
437                  e->Delete();                  e->Delete();
438                  return -1;                  return -1;
439          }          }
# Line 462  int base::s_receive(CString& out_str, ch Line 470  int base::s_receive(CString& out_str, ch
470          }          }
471          catch(CException* e)          catch(CException* e)
472          {          {
473                  syslog << logfile::log_head << "Error in s_receive()" << endl;                  char strErrMsg[1024];
474                    e->GetErrorMessage(strErrMsg,1024);
475                    syslog << logfile::log_head << "Error in s_receive() [" << strErrMsg << "]" << endl;
476                  e->Delete();                  e->Delete();
477                  return -1;                  return -1;
478          }          }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1