TheVillageIdiot
TheVillageIdiot

Reputation: 40507

What is difference in adodb and oledb?

What is the difference between adodb and oledb?

What is the relation between these two?

Where does ado.net stands in context of adodb and oledb?

Upvotes: 49

Views: 56243

Answers (2)

Sidharth Panwar
Sidharth Panwar

Reputation: 4654

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:

  1. 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.
  2. 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.

Upvotes: 47

Jonathan Allen
Jonathan Allen

Reputation: 70307

  • 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

Upvotes: 20

Related Questions