CDatabase Open
-
hello @all, i connected my mfc program and an access database with ODBC.
CDatabase db; db.Open(_T( "MyDatabase" ), FALSE, FALSE, _T( "ODBC"));
the ODBC driver of my database is called 'MyDatabase'. but when i use this code, the database is not selected. i must select it myself! what must i change to select my odbc driver from the program (i have to do nothing, after i start the program)? thanks mfc -
hello @all, i connected my mfc program and an access database with ODBC.
CDatabase db; db.Open(_T( "MyDatabase" ), FALSE, FALSE, _T( "ODBC"));
the ODBC driver of my database is called 'MyDatabase'. but when i use this code, the database is not selected. i must select it myself! what must i change to select my odbc driver from the program (i have to do nothing, after i start the program)? thanks mfcIs there a reason you are using ODBC and not ADO or even DAO? You'd probably find ADO more friendly and there are plenty of good classes on CP to make it even easier. Michael Fat bottomed girls You make the rockin' world go round -- Queen
-
Is there a reason you are using ODBC and not ADO or even DAO? You'd probably find ADO more friendly and there are plenty of good classes on CP to make it even easier. Michael Fat bottomed girls You make the rockin' world go round -- Queen
i ever use ODBC (i know, that is no argument :-D), i think it is better. but i found my mistake. i forgot: db.Open(_T( "MyDatabase" ),false, false, "ODBC;UID=sa"); thanks for your reply. :rose::rose: mfc