Using a DB with C++ is a real mess and it was refreshing when I moved to Java to be able to use a unified system to abstract the whole layer away (aka Hibernate).
There
If you're using C++ with .Net, then use nhibernate. 2.0 is approximately the same as hibernate 3.0, and is extremely robust.