SQLite with MFC

I want to use SQLite in my MFC application.

to do this, I will create an object whose job must interact directly with the database (SQLite) to isolate the rest of the application from the database code.

Can anyone point me to a good tutorial? I need operations like (create, delete, insert, update, createb, dropdb, etc.)

Thanks.

+1


a source to share


4 answers


There is a page on the SQLite site that lists many of the available wrappers - here . The C ++ wrapper that Daniel mentions in his answer is probably the most common, although it doesn't support Unicode and the SQLite DLL that comes with it is pretty outdated. There's a Unicode version of that wrapper here , but it's a bit buggy and requires some more work. However, it can save you from writing it all from scratch.



+2


a source


Look at this. It was really easy to port to MFC classes, but it will get you started.



http://www.codeproject.com/KB/database/CppSQLite.aspx

+1


a source


Or you can just #include "sqlite3.h", add sqlite3.lib to your linker, and use sqlite3.dll directly from the C api. This is what I did in my MFC application.

And you can even statically link sqlite3 to your application. Download the union and enable it! It adds about 400 to.

+1


a source


Please define your problem more clearly. sqlite can be coded with c and you can read the sample on their site.

0


a source







All Articles