/[H9]/trunk/FlisServer/FlisServerDlg.cpp
ViewVC logotype

Diff of /trunk/FlisServer/FlisServerDlg.cpp

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

revision 144 by kevin, Tue Dec 4 13:26:00 2007 UTC revision 146 by kevin, Tue Dec 4 13:48:52 2007 UTC
# Line 923  vector<keepalive> CFlisServerDlg::keepal Line 923  vector<keepalive> CFlisServerDlg::keepal
923          CString SQL, name, value;          CString SQL, name, value;
924          SQL = "select name, value from config;";          SQL = "select name, value from config;";
925          CRecordset rs(&db);          CRecordset rs(&db);
926          rs.Open(AFX_DB_USE_DEFAULT_TYPE, SQL);          try
         if (rs.GetRecordCount()>0)  
927          {          {
928                  rs.MoveFirst();                  rs.Open(AFX_DB_USE_DEFAULT_TYPE, SQL);
929                    if (rs.GetRecordCount()>0)
930                    {
931                            rs.MoveFirst();
932                                                    
933                  rs.GetFieldValue((short)0, name);                          rs.GetFieldValue((short)0, name);
934                  rs.GetFieldValue(1,value);                          rs.GetFieldValue(1,value);
935                                    
936                  Alive.name = name;                          Alive.name = name;
937                  Alive.value = value;                          Alive.value = value;
938                  Alive.tid = CTime::GetCurrentTime();                          Alive.tid = CTime::GetCurrentTime();
939                  if(Alive.name == "phonenr")                          if(Alive.name == "phonenr")
940                  {                          {
941                          Alive.Phonenr = value;                                  Alive.Phonenr = value;
942                  }                          }
943    
944                  buffer.push_back(Alive);                          buffer.push_back(Alive);
945                  rs.MoveNext();                          rs.MoveNext();
946    
947                    }
948                    rs.Close();
949                    return buffer;
950          }          }
951          rs.Close();          catch (char * str)
952          return buffer;          {
953                    AppendText("Keepalive failed, closing and opening the db connection again");
954                    if(db.IsOpen())
955                    {
956                            db.Close();
957                            AppendText("DB connection closed");
958                    }
959                    if(!db.IsOpen())
960                    {
961                            DBConnect();
962                            AppendText("DB connection started again");
963                    }
964            }
965    
966                    
967  }  }

Legend:
Removed from v.144  
changed lines
  Added in v.146

  ViewVC Help
Powered by ViewVC 1.1.20