6 |
#include ".\MicrosoftDBLayer.h" |
#include ".\MicrosoftDBLayer.h" |
7 |
|
|
8 |
|
|
9 |
MicrosoftDBLayer::MicrosoftDBLayer(void) |
MicrosoftDBLayer::MicrosoftDBLayer(ConfigFile &config) |
10 |
{ |
{ |
11 |
db.OpenEx("ODBC; Description=; DRIVER=SQL Server; SERVER=TK-Teacher; UID=GroupTwo; PWD=toog30", CDatabase::noOdbcDialog); |
CString dsn; |
12 |
db.ExecuteSQL("USE GroupTwo"); |
dsn.Format("ODBC; Description=; DRIVER=SQL Server; SERVER=%s; UID=%s; PWD=%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 |
MicrosoftDBLayer::~MicrosoftDBLayer(void) |
MicrosoftDBLayer::~MicrosoftDBLayer(void) |