/[H6]/h6-udlånssystemDlg.cpp
ViewVC logotype

Diff of /h6-udlånssystemDlg.cpp

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

revision 47 by torben, Wed Sep 6 20:27:24 2006 UTC revision 60 by torben, Mon Oct 22 13:00:14 2007 UTC
# Line 120  BOOL Ch6udlnssystemDlg::OnInitDialog() Line 120  BOOL Ch6udlnssystemDlg::OnInitDialog()
120          } catch(...) {          } catch(...) {
121                  MessageBox("Could not open config file");                  MessageBox("Could not open config file");
122                  OnOK();                  OnOK();
123                    return true;
124          }          }
125    
126            DatabaseLayer *dbl = 0;
127          try {          try {
                 DatabaseLayer *dbl = 0;  
128                  if (config.driver.MakeLower() == "mysql")                  if (config.driver.MakeLower() == "mysql")
129                          dbl = new MySQLLayer(config);                          dbl = new MySQLLayer(config);
130                  else if (config.driver.MakeLower() == "postgresql")                  else if (config.driver.MakeLower() == "postgresql")
# Line 136  BOOL Ch6udlnssystemDlg::OnInitDialog() Line 137  BOOL Ch6udlnssystemDlg::OnInitDialog()
137                          MessageBox(tmp);                          MessageBox(tmp);
138                          OnOK();                          OnOK();
139                  }                  }
140                  CommonStorage::Instance()->setDBLayer(dbl);          } catch (CDBException *ex) {
         } catch (...) {  
141                  MessageBox(CString("Could not establish connection to the database server\r\n") +                  MessageBox(CString("Could not establish connection to the database server\r\n") +
142                                     "Please contact your network administrator");                                     "Please contact your network administrator\r\n\r\n" +
143                                       "ODBC Returned the following message:\r\n" +
144                                       ex->m_strError);
145                    
146                    OnOK();
147            } catch (...) {
148                    MessageBox("Unknown DB exception");
149                  OnOK();                  OnOK();
150          }          }
151    
152            CommonStorage::Instance()->setDBLayer(dbl);
153    
154            CString title = "H6-Udlånssystem - ";
155            title += config.driver;
156            SetWindowText(title);
157    
158          // TODO: Add extra initialization here          // TODO: Add extra initialization here
159                    

Legend:
Removed from v.47  
changed lines
  Added in v.60

  ViewVC Help
Powered by ViewVC 1.1.20