database

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
sinacetinerAsked:
Who is Participating?
 
itsmeandnobodyelseConnect With a Mentor Commented:
>> 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

 
0
 
Jaime OlivaresSoftware ArchitectCommented:
You will find lots of C++ database examples at codeproject.com:
http://www.codeproject.com/database/
0
 
itsmeandnobodyelseCommented:
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
0
 
sinacetinerAuthor Commented:
m_pConnection->Open(
                        _bstr_t(L"Provider=Microsoft.Jet.OLEDB.3.51; Data Source=c:\\Student.mdb;"),
                        _bstr_t(L""),
                        _bstr_t(L""),
                        adModeUnknown
                  );
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.
0
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.

All Courses

From novice to tech pro — start learning today.