We help IT Professionals succeed at work.

ODBC Connections to Access/Oracle via C++

JK2429
JK2429 asked
on
Medium Priority
774 Views
Last Modified: 2012-05-04
Experts, I have spent countless hours on google looking for a way to connect to a database using c++.  As many people out there, I hate the MSDN provided my microsoft.  It is not very helpful.  Google didn't return much luck either.  Any sites/books to point me in the right direction?

I will be querying a database where the requests are sent by a remote server, and returning the results to it.  Not sure how, but I'm sure that the experts here will help me find a clever way to do so.

Thanks!!
Comment
Watch Question

Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Take a look at Terimber C++ Db library
http://www.terimber.com/text/download/dbaccess.html

Author

Commented:
I will be accessing Access database  (Pitiful, I know!!).  Alex, do you have the source code I can view, It seems that I have will be doing something similar to what you have provided me with.
It's an huge C++ class library rather than a simple-to-copy application sample. It doesn't use MFC but my own standard libraries and is far too much code to post it here in EE. In fact it is ten times bigger than MFC recordsets as it works as a factory to make C++ classes persistent and get C++ instances from a database query.

I would suggest you adopting the sample code from above. You can make queries on all existing tables of an ACCESS or ORACLE datasource with that. We easily could add code to update, insert and delete records as it is always the same simple sequence:

    - build the SQL statement
    - allocate that statement
    - use SQLExecDirect(..) to perform the statement

In fact the select statement from above is the most complicated of all as it requires fetching a result set after the statement is executed.

Regards, Alex

Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.