Serving the Quantitative Finance Community

 
User avatar
nuclph
Topic Author
Posts: 0
Joined: July 7th, 2006, 12:26 pm

Reading MS Access with Visual C++ without MFC support ?

December 15th, 2008, 1:16 pm

Hi All,Does anybody know how to read MS Access database without MFC support?For example, with MFC support I can use CDatabase and CRecordset classes to do it.I just wondering, can I bypass it somehow without using MFC libraries...Thank you in advance.
 
User avatar
nuclph
Topic Author
Posts: 0
Joined: July 7th, 2006, 12:26 pm

Reading MS Access with Visual C++ without MFC support ?

December 16th, 2008, 2:03 am

I found link how it is possible to do. In this example, it is shown how to create simple MS access database.http://www.codeproject.com/KB/database/cppdao.aspxI will be glad if someone will show another way to do it bypassing usage of MFC libraries.Is anybody have good link to read about usage of dao360.dll?Thank you,nuclph.
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

Reading MS Access with Visual C++ without MFC support ?

December 16th, 2008, 12:23 pm

I think what you need is ODBC, which will let you get stuff to and from a huge range of data sources include Access ,flat files, Oracle, etc.http://msdn.microsoft.com/en-us/library ... S.85).aspx
 
User avatar
nuclph
Topic Author
Posts: 0
Joined: July 7th, 2006, 12:26 pm

Reading MS Access with Visual C++ without MFC support ?

December 16th, 2008, 12:59 pm

Thank you DCFC for the link.But ODBC in Visual C++ 2008 is still dependent on MFC, I need to create a project with MFC support?I would like to be able to create project with Configuration Properties: Use of MFC: "USE Standard Windows library" and not "USE MFC in Shared DLL"
 
User avatar
dionysus
Posts: 0
Joined: November 16th, 2006, 5:46 am

Reading MS Access with Visual C++ without MFC support ?

December 16th, 2008, 11:24 pm

What about this one?Simple ODBC classes without MFCBy Justin KirbyA collection of simple classes to connect to ODBC capable DBMS and share those connectionsIntroductionI have written a lot of database apps. Most of them have been small, and I soon realized that the CRecordset class was the only class requiring MFC for the majority of those apps. So, I sat down and wrote these classes to provide most of the functionality I needed and so I could get rid of MFC dependancies. .... http://www.codeproject.com/KB/database/simple_odbc.aspx
Last edited by dionysus on December 16th, 2008, 11:00 pm, edited 1 time in total.
 
User avatar
Marine
Posts: 0
Joined: July 17th, 2003, 7:56 am

Reading MS Access with Visual C++ without MFC support ?

December 17th, 2008, 7:54 am

Why don't you want to use MFC but still want to use VC++ and MS Access?It sounds like you could me making the problem harder than it needs to be. CRecordset is so simple the wizard does everything. You cannot be optimizing for speed because you are using MS Access.Is it because you are using another library which doesn't support MFC and you are receiving linking errors?
 
User avatar
nuclph
Topic Author
Posts: 0
Joined: July 7th, 2006, 12:26 pm

Reading MS Access with Visual C++ without MFC support ?

December 17th, 2008, 12:31 pm

Thank you dionysus, I will look on it.
 
User avatar
nuclph
Topic Author
Posts: 0
Joined: July 7th, 2006, 12:26 pm

Reading MS Access with Visual C++ without MFC support ?

December 17th, 2008, 12:34 pm

Marine,I agree that to use MFC much more easier. I am forced not to use it just because I am using XLW libraryand I cannot compile it with MFC.
 
User avatar
DominicConnor
Posts: 41
Joined: July 14th, 2002, 3:00 am

Reading MS Access with Visual C++ without MFC support ?

December 17th, 2008, 12:51 pm

Although there is MFC support for ODBC, ODBC itself is a C style API, can even be used from VB.I didn't know about the XLW problem, my solution to that would be to build a DLL that did database stuff, then your XLW code simply does not need to care.
 
User avatar
nuclph
Topic Author
Posts: 0
Joined: July 7th, 2006, 12:26 pm

Reading MS Access with Visual C++ without MFC support ?

December 17th, 2008, 2:34 pm

Hello DCFC,Actually, I already put part of the code which is reading database into VBA code. Thus, solve problem withinterfacing XLW and MFC.Thank you again.