--- h6-udlÃ¥nssystemDlg.cpp 2006/09/12 17:48:20 57 +++ h6-udlÃ¥nssystemDlg.cpp 2007/10/22 13:00:14 60 @@ -123,8 +123,8 @@ return true; } + DatabaseLayer *dbl = 0; try { - DatabaseLayer *dbl = 0; if (config.driver.MakeLower() == "mysql") dbl = new MySQLLayer(config); else if (config.driver.MakeLower() == "postgresql") @@ -137,7 +137,6 @@ MessageBox(tmp); OnOK(); } - CommonStorage::Instance()->setDBLayer(dbl); } catch (CDBException *ex) { MessageBox(CString("Could not establish connection to the database server\r\n") + "Please contact your network administrator\r\n\r\n" + @@ -150,6 +149,8 @@ OnOK(); } + CommonStorage::Instance()->setDBLayer(dbl); + CString title = "H6-Udlånssystem - "; title += config.driver; SetWindowText(title);