visit the following link hope it will helpful to you.
http://www.codeproject.com/KB/cpp/ADO_DB.aspx