Easiest way to use SQL with C++ Programs?

Does anyone know how I could link up a c++ program with a database, and perform SQL queries on it?

I've heard of people calling little scripts to do it. I've also looked at ODBC, but it looks super complicated. I'm lost on where to begin.
You could use mysql++ if you have a MySQL database:
http://tangentsoft.net/mysql++/

If you don't need a remote database, SQLite is the way to go.
Which database will you be using?
Using something like SqlLite, QT, WxWidgets would be fine.
Thank. I'm gonna try to get SQLite working. Do you know of any good resources(tutorials/example code/ etc)
to help get me started?
Last edited on
ODBC is less complicated that it appears. The functions are heavy, but there are only a small number of them. And the documentation is available on MSDN. I found it best to jump in and use it rather than trying to simply understand it before beginning.
Last edited on
http://www.sqlite.org/index.html

SQLite is pretty easy to get working. I think it only took me about 20-30mins to get it working. The only thing you have to be aware of is that if you're embedding the code within your application the files (.c) have to be configured to compile as a C file (not C++).

But their site has good documentation and samples.
Topic archived. No new replies allowed.