6 |
#include ".\MySQLLayer.h" |
#include ".\MySQLLayer.h" |
7 |
|
|
8 |
|
|
9 |
MySQLLayer::MySQLLayer(void) |
MySQLLayer::MySQLLayer(ConfigFile &config) |
10 |
{ |
{ |
11 |
db.OpenEx("ODBC;Description=asd;DRIVER=MySQL ODBC 3.51 Driver;SERVER=172.16.11.25; user=gruppe2;password=1337",CDatabase::noOdbcDialog); |
CString dsn; |
12 |
db.ExecuteSQL("USE Gruppe2"); |
dsn.Format("ODBC;Description=asd;DRIVER=MySQL ODBC 3.51 Driver;SERVER=%s;user=%s;password=%s", config.host, config.username, config.password); |
13 |
|
db.OpenEx(dsn, CDatabase::noOdbcDialog); |
14 |
|
|
15 |
|
CString sql; |
16 |
|
sql.Format("USE %s", config.database); |
17 |
|
db.ExecuteSQL( sql ); |
18 |
} |
} |
19 |
|
|
20 |
MySQLLayer::~MySQLLayer(void) |
MySQLLayer::~MySQLLayer(void) |