• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:


hi everyone,
My problem is a bit ordinary, I want to reach a database by using C++. I look at msdn.microsoft.com but here there is no code about C++. msdn talked about C# and visual basic. How can I start.
NOTE: I want to reach the sql databases that are written in microsoft access.
thanks for all
  • 2
1 Solution
Jaime OlivaresSoftware ArchitectCommented:
You will find lots of C++ database examples at codeproject.com:
When using MFC you can use CDaoRecordset or CRecordset (ODBC) classes. There is a lot of documentation also in msdn.

There is also a native C interface to ODBC that you can find in sqlext.h.

Last but not the simplest is a COM interface called ADO or ADODB.

On MSVC 6.0 IDE i would recommend MFC classes as you can easily create them using Class Wizard.

Regards, Alex
sinacetinerAuthor Commented:
                        _bstr_t(L"Provider=Microsoft.Jet.OLEDB.3.51; Data Source=c:\\Student.mdb;"),
actually what makes this code? what is Microsoft.Jet.OLEDB.3.51
I ask this because I take this code from an e-book. In that book author used a database file. I couldnt find it and tried to use another one. But this time because of version difference again I couldnt see how this code works.
NOTE; author used a ms access database file. Also I used ms access file.
>> actually what makes this code?

It opens a database connection to an Access mdb-file.

what is Microsoft.Jet.OLEDB.3.51

That's better known as ADO or ADODB. Here you have a COM (or OLE) interface that has similar calls and objects than that of MFC. However, because of the COM overhead it is much more difficult to use it.

Regards, Alex

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now