I have a MFC dialog based project,Now I want to add database with that project. I have no idea how to do this. can anybody provide the useful link?
Actually when I create a new dialog based MFC project, the database support is hide. So I want to ask that
MFC dialog base project support database or not
When I create new Dialog based MFC project
Database support is hide.
The database support in appwizard is ment for doc/view architecture. It will quickly help you to create ODBC classes.
Definitely you can use database in MFC applications. you can use ODBC/ADO to connect to the database and access it. You can refer these sites
You should better directly use
CDatabase
andCRecordset
classes to open to the database, and read/write to the tables, or call SQL using differentCRecordset
objects.You need only one
CDatabase
object, and attach it to differentCRecordset
instances (one at a time). You may directly useCRecordset
and useGetFieldValue
method in a loop (controlled byIsEOF
method). Or you may inherit fromCRecordset
and implementDoFieldExchange
. See here.