What is difference in adodb and oledb?
Solution 1
Adodb (ActiveX Data Objects DB) is an API layer over OLE DB. It works well with MS-based databases such as Sql Server, providing a consistent API and optimizations. That being said you can use ADODB to connect with non-MS data sources as well but that would mean that you will require an OLEDB/ODBC Provider for the data source.
In simpler terms, to connect to any data source you need a driver. Here are a couple of common scenarios to think of:
- ADODB for Data Source that has ODBC Driver Only - ADODB uses OLEDB Provider for ODBC which loads ODBC Driver which then connects to Data Source.
- ADODB for Data Source with OLEDB Driver (like SQL Server) - ADODB uses OLEDB Provider for SQL Server to talk directly with DB.
Oledb (Object Linking and Embedding DB) is a standard format supported by a large number of dbs, so you can connect to oracle, db2 etc. using Oledb. You can also use OLEDB directly to connect to Sql Server but the API is messier as compared to a adodb connection which is optimized to work with Sql Server and MS Access.
ADO.Net is a .Net based db connection "architecture". In ADO.Net there's a library for Oledb - System.Data.OledbClient. Adodb has been replaced/upgraded and ADO.Net now uses the System.Data.SqlClient library for MS-based databases/data providers.
Solution 2
- ADO is a COM-based library for accessing databases.
- OleDB and ODBC are standards for communicating with databases.
- ADO uses the OleDB to talk to any database that exposes an OleDB driver.
- There is also an OleDB driver that can wrap any ODBC driver. Thus ADO can also talk to any database that exposes an ODBC driver.
- ADO.NET (a.k.a. System.Data) is a .NET based library for accessing databases.
- ADO.NET has built-in support for SQL Server, OleDB, and ODBC
- Third parties can expose their database to ADO.NET by building a ADO.NET compatible library
- Third parties can also expose their database to ADO.NET by offering an OleDB or ODBC driver
Related videos on Youtube

TheVillageIdiot
Working as a senior software developer with fin-tech startup.
Updated on May 03, 2022Comments
-
TheVillageIdiot 11 days
What is the difference between
adodb
andoledb
?What is the relation between these two?
Where does
ado.net
stands in context ofadodb
andoledb
?-
nawfal about 9 yearspossible duplicate of What are the pros and cons of OleDB versus SQLClient?
-
-
Smith over 9 yearsyou might have missed something out,
Oledb
can connet to msaccess. i use this often -
Jonathan Allen about 6 yearsThat's very misleading. ADO is an API on top of OleDB and can work with any database that provides OleDB drivers, not just ones from Microsoft.
-
Sidharth Panwar over 5 yearsUpdated some parts of my answer to give a better understanding of these technologies.