123 |
return true; |
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") |
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 - "; |
CString title = "H6-Udlånssystem - "; |
155 |
title += config.driver; |
title += config.driver; |
156 |
SetWindowText(title); |
SetWindowText(title); |