--- h6-udlÃ¥nssystemDlg.cpp 2006/09/07 06:43:32 48 +++ h6-udlÃ¥nssystemDlg.cpp 2007/10/22 13:00:14 60 @@ -120,10 +120,11 @@ } catch(...) { MessageBox("Could not open config file"); OnOK(); + return true; } + DatabaseLayer *dbl = 0; try { - DatabaseLayer *dbl = 0; if (config.driver.MakeLower() == "mysql") dbl = new MySQLLayer(config); else if (config.driver.MakeLower() == "postgresql") @@ -136,13 +137,20 @@ MessageBox(tmp); OnOK(); } - CommonStorage::Instance()->setDBLayer(dbl); - } catch (...) { + } catch (CDBException *ex) { MessageBox(CString("Could not establish connection to the database server\r\n") + - "Please contact your network administrator"); + "Please contact your network administrator\r\n\r\n" + + "ODBC Returned the following message:\r\n" + + ex->m_strError); + + OnOK(); + } catch (...) { + MessageBox("Unknown DB exception"); OnOK(); } + CommonStorage::Instance()->setDBLayer(dbl); + CString title = "H6-Udlånssystem - "; title += config.driver; SetWindowText(title);