Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am currently migrating a C++ app using MFC from DAO to ODBC. I have an embedded Microsoft Access database.

It's hard for me to understand what is required to use an embedded Access database with ODBC.
I know that I need a driver, is it the same driver for an embedded and not embedded Access database ? For now I only found this which is supposed to contain a driver for ODBC.
What I am supposed to do then in the OBDC administrator on Windows?
What should I do in Visual Studio C++ to link my app to my database?

Thanks !

What I have tried:

Tried to find infos but I mainly found things about SQL Server which is not embedded. I heard about "file-based mode" but it seems to be related to DSN file and not to database file. I know from the book Access Database Design & Programming by Steven Roman that I need a file-based driver, but I have no idea where to download it and how to use it then.
Posted
Updated 11-Dec-17 23:47pm
Comments
[no name] 12-Dec-17 5:56am    
I think this can be a good starting Point: Connect to data in an Access database (Windows Forms)[^]
Leo Chapiro 12-Dec-17 6:07am    
The link you shared refers to .NET rather then to C++/MFC?
[no name] 12-Dec-17 6:32am    
Thanks for the hint.

1 solution

Try to use CDatabase Class[^] :
C++
// This fragment is taken from the declaration for CMyDatabaseDoc
// CMyDatabaseDoc is derived from CDocument.
public:
   // Declare a CDatabase embedded in the document
   CDatabase m_dbCust;

   m_dbCust.OpenEx(_T("DSN=MFC_ODBCTest;UID=JOES"));
 
Share this answer
 
Comments
SheepSpeech 13-Dec-17 6:35am    
And the database will be fully embedded? (The client machines won't need Access ?)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900