Solved

database

Posted on 2004-08-25
4
327 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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.

830 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