Solved

database

Posted on 2004-08-25
4
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

630 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