what the difference between ODBC and OLE DB?

October 19, 2008 9:51pm CST
i'm complexed by the two difinitions. i can use OLE DB to set up a connection via OLE DB component in .net and query data from the database. but there still exist an ODBC. i can't see any difference beween them.anybody can tell me ?
1 person likes this
2 responses
@Beruang (1309)
• Malaysia
20 Oct 08
ODBC is normally used for connecting an application to a database. For example, if you are running an application using the SQL database and you want to write a report to extract some data from the database using a report writer such as Crystal Report Writer, you need to create an ODBC connection to the database so that the application would be able to understand the data structure of your database and therefore, would be able to pull out the data for you. As for OLE DB, I am not that familiar with it but it is just one of the ways that can be used to connect to a database as well and I believe you can use either one and do not have to use both. If I am not mistaken, while ODBC connects via a data Source, OLE DB connects directly to the database using the database name itself but then, I could be wrong here. Hope you would be able to find a better answer. Cheers!
• China
20 Oct 08
yes.both of them can be used to estabilsh a connection between the programme and database. i've heard that ODBC is desgined to unify the different database to one single connection,although different brand of database such as SQL 2005 and ORACLE 9i.we can olny set up one connection and use standardized query language to get data. prehaps OLE DB is only a updated edition of the communication component.
@ishralene09 (2260)
• Philippines
20 Oct 08
I'm not really sure about OLE DB, but I've heard my classmate using ODBC in their thesis because they are using Visual Basic 6. ODBC is Open Database Connectivity, and I think it's used for open-source database connections. He used it to connect MS SQL 2000 to VB6, and I've read that it is also used in PHP and other stuffs. Maybe OLE DB is for .Net only...I think. I'll dig deeper about this. But usually when there is no direct interface between a language and a database ODBC is used, well that is what my friend usually tells me. I'm a .Net slave. He's open-source.
• China
20 Oct 08
thanks for you answer.