Solved

database

Posted on 2004-08-25
4
320 Views
Last Modified: 2013-11-25
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
0
Comment
Question by:sinacetiner
  • 2
4 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11889847
You will find lots of C++ database examples at codeproject.com:
http://www.codeproject.com/database/
0
 
LVL 39

Expert Comment

by:itsmeandnobodyelse
ID: 11890614
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
 

Author Comment

by:sinacetiner
ID: 11891242
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
 
LVL 39

Accepted Solution

by:
itsmeandnobodyelse earned 100 total points
ID: 11891642
>> 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

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall‚Ķ
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now