--- MySQLLayer.cpp 2006/09/05 12:50:38 41 +++ MySQLLayer.cpp 2006/09/06 20:27:24 47 @@ -6,10 +6,15 @@ #include ".\MySQLLayer.h" -MySQLLayer::MySQLLayer(void) +MySQLLayer::MySQLLayer(ConfigFile &config) { - db.OpenEx("ODBC;Description=asd;DRIVER=MySQL ODBC 3.51 Driver;SERVER=172.16.11.25; user=gruppe2;password=1337",CDatabase::noOdbcDialog); - db.ExecuteSQL("USE Gruppe2"); + CString dsn; + dsn.Format("ODBC;Description=asd;DRIVER=MySQL ODBC 3.51 Driver;SERVER=%s;user=%s;password=%s", config.host, config.username, config.password); + db.OpenEx(dsn, CDatabase::noOdbcDialog); + + CString sql; + sql.Format("USE %s", config.database); + db.ExecuteSQL( sql ); } MySQLLayer::~MySQLLayer(void)