Newsreel
Products & Services
Web Watch
Software Update Resource Directory
Events Diary
Articles
The Magazine
Subscribe
Contact Us
Advertisers
TechEd reports
Exhibitors
Fun stuff |

Improve your database programming
using C++
July 8 - Dino Esposito talks to Tony Goodhew, Visual C++ Program Manager at
Microsoft.
Dino: Which is the best and most efficient way to access data with C++?
Tony: Well, the answer is simple: use OLE DB if you want to
get the best performance. We've designed it just to try to get data in the shortest time
and in the most direct way.
Dino: Architecturally speaking, OLE DB appears to be more
layered than ODBC, which can be considered its father, at least from a certain point of
view. Being more layered, though, means an overhead. How does this fit with what you said
before?
Tony: You're right when you say that ODBC is even faster than
OLE DB because the stratification of OLE DB produces a natural overhead. But, anyway,
consider that this overhead is really minimal and not significant for almost all the
applications. What you get at this price, though, is easy maintainance, flexibility,
scalability, better design, access to any data source. I think it is really worth a slight
overhead.
Dino: What about ActiveX Data Objects (ADO)? Lots of
developers are using it mostly from within Visual Basic and ASP applications, but also
with C++. And they're facing lots of little and sticky problems. On the other hand, the
raw OLE DB API is bothersome to use, and if you choose ATL classes you have to 'manually'
integrate them in console or non-MFC. What do you think about?
Tony: First off, with console or non MFC applications
integrating ATL classes is not that hard after all. You have to put in a standard piece of
code with old plain cut-and-paste. Actually, it's really a do-able thing. As for ADO,
remember that we designed it mostly to make OLE DB accessible to Visual Basic programmers.
ADO can be up to 20-25 times slower than a raw or ATL based approach. So my recommendation
is always to use OLE DB if you're doing database programming with C++. ATL classes do a
great job to make it easy for you to work with OLE DB interfaces.
Dino: Are all the new features of OLE DB 2.5 being included in a new version of
ATL?
Tony: Yes, they are. We're doing a lot of work about that.
However, you won't have available any new ATL version through service packs, but have to
wait for Visual C++ 7.0.
|
Article: OLE DB 2.5
Article:
Universal
Data Access |