Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all ,

I have an application written in MFC which uses MS Access as the database.
Now, I want to migrate this database to SQLite.
I have few questions around it :
1. Should I write a framework which creates all the equivalent classes such as CDaoDatabase , CDaoRecordSet using sqlite apis.
2. Or should I simply remove all the database classes used by my application and use the sqlite wherever the calls to the database apis are done.
Or could there be a simpler way of migrating the database without changing much of the code.

thanks in advance

What I have tried:

I tried creating the equivalent classes but this will take lot of efforts to write each and every api.
Posted
Updated 2-Feb-23 1:04am

1 solution

To be honest it sound like your original app is badly designed, if the actual database is that tightly coupled to your business and / or presentation code - in a well designed app, it should be possible to extract the DB related code and replace it with a new assembly / library, so the business and presentation layers remain untouched.

If it's going to be that much work, I'd probably throw it away, and restart using a more modern framework than the rather antiquated MFC and designing it to use a three layer model so this doesn't happen again when you discover that SQLite doesn't support Stored Procedures for example and have to switch DB again. (MFC is older than a significant portion of the coders using C++ - it came out in 1992!)

But without access to the whole app it's pretty much impossible to tell you what to do other than that.
 
Share this answer
 
Comments
iampradeepsharma 2-Feb-23 7:14am    
Your answer is really honest.
OriginalGriff 2-Feb-23 8:07am    
Sorry! But ...

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