Reputation: 5264
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.
Upvotes: 0
Views: 2925
Reputation: 18411
You should better directly use CDatabase
and CRecordset
classes to open to the database, and read/write to the tables, or call SQL using different CRecordset
objects.
You need only one CDatabase
object, and attach it to different CRecordset
instances (one at a time). You may directly use CRecordset
and use GetFieldValue
method in a loop (controlled by IsEOF
method). Or you may inherit from CRecordset
and implement DoFieldExchange
. See here.
Upvotes: 1
Reputation: 4663
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
Upvotes: 1