How to use MFC to design an app that can connect 2 types of database
-
I never use VC++ to develop an app that use to connect and update database before. My app is design to allow user to update the database by supply MS Excel file. When the app open, user need to choose either connect to MS Access 2010 (.mdb) or MSSQL 2014 express. By using MFC Application Wizard, I need to choose which client type to use at Database support section (ODBC or OLEDB). After reference to the doc on the web. Seems that OLEDB suitable for Access and ODBC suitable for MSSQL. This make me has a difficulty to choose between them during start. Or I should create a project that has no database support at start, then add DLL that support database to this solution later. But the wizard that use to create MFC DLL and ATL Project has no section for choose database support. Any advice and suggestion that direct me how to start is appreciated.
-
I never use VC++ to develop an app that use to connect and update database before. My app is design to allow user to update the database by supply MS Excel file. When the app open, user need to choose either connect to MS Access 2010 (.mdb) or MSSQL 2014 express. By using MFC Application Wizard, I need to choose which client type to use at Database support section (ODBC or OLEDB). After reference to the doc on the web. Seems that OLEDB suitable for Access and ODBC suitable for MSSQL. This make me has a difficulty to choose between them during start. Or I should create a project that has no database support at start, then add DLL that support database to this solution later. But the wizard that use to create MFC DLL and ATL Project has no section for choose database support. Any advice and suggestion that direct me how to start is appreciated.
There are no limitations to support different types of databases in one application. The application wizard only prepares the project to support a specific database interface. Support for other interfaces can be added later manually. My suggestion: Create two new empty projects with support for different database interfaces. Then choose one as your project and add the necessary definitions from the created source files of the other project by comparing the files.
-
There are no limitations to support different types of databases in one application. The application wizard only prepares the project to support a specific database interface. Support for other interfaces can be added later manually. My suggestion: Create two new empty projects with support for different database interfaces. Then choose one as your project and add the necessary definitions from the created source files of the other project by comparing the files.
-
Thanks for reply. Since wizard can relief my work. I just think is it possible to select both ODBC and OLEDB by using wizard. If it is not possible, I have to implement the code myself. That's hell a lot of work X|
The selection uses radio buttons. So only one can be selected. You must write the code to access the database anyway. The wizard will not do that. It just prepares your project. Merging two empty projects into one is not much work.
-
I never use VC++ to develop an app that use to connect and update database before. My app is design to allow user to update the database by supply MS Excel file. When the app open, user need to choose either connect to MS Access 2010 (.mdb) or MSSQL 2014 express. By using MFC Application Wizard, I need to choose which client type to use at Database support section (ODBC or OLEDB). After reference to the doc on the web. Seems that OLEDB suitable for Access and ODBC suitable for MSSQL. This make me has a difficulty to choose between them during start. Or I should create a project that has no database support at start, then add DLL that support database to this solution later. But the wizard that use to create MFC DLL and ATL Project has no section for choose database support. Any advice and suggestion that direct me how to start is appreciated.