OLEDB vs. ODBC

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
Can someone give me a technical reason why OLEDB is prefered over ODBC? All I can find are articles stating that you should use OLEDB over ODBC, but never go into the technical differences between the two. Through experience, I've notive fewer (if any) problems using OLEDB, but I have seen sites that perform better when switched to OLEDB.
 

jonmullen

Platinum Member
Jun 17, 2002
2,517
0
0
this help, as I see it optemizes calls to the database, and it really does not replace ODBC just sits between in and the application layer

edit:why does fusetalk link syntax have to be backwards
 

stephbu

Senior member
Jan 1, 2004
249
0
0
OLEDB provides better programming models to manipulate tabular and non-tabular graphs. (latter was something hard to perform in ODBC) It combines elements from then existing database technologies ODBC, RDO and DAO, using COM to build interface-driven API.

It is especially well matched to the ADO paradigms. It is designed for higher performance, and better compliance with enterprise systems such as transaction monitors. Another goal was to drive access to non-tabular data such as Exchange or Index Server.

OLEDB interfaces are peers of the ODBC API - just as OLEDB providers are a peer of ODBC drivers. OLEDB is NOT a layer over ODBC (though there is a bridge driver to do just that if you can't get an OLEDB driver for your database). That 4guysonaroll article is incorrect - it was written when the technology was immature (1999) and there were very few OLEDB providers.

Some history on where OLEDB comes from in here...
http://msdn.microsoft.com/library/en-us/dnoledb/html/choosingcomponents.asp
 

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
jonmullen, I found that link... Like most 4guys articles, they really glaze over the technical details. I do believe that many of their articles are accurate though, and do promote somewhat decent coding practices. It's just that most of their articles always wanting more information regarding their decisions.

stephbu, thanks! I ran across another msdn article but it wasn't as detailed as that! I think there are two things I need to learn a bit more about if I really want to understand the benefits though: I need a deeper understanding of COM, and protocol level details of what a database driver does. Oh, and welcome to the forums :D

Now to try and explain some of this to people who do not understand that "SELECT * FROM myTable" isn't very good, especially when you only desire one row from the query.