Skip to content
Search

OLE DB

lastmod 2025-02-26created 2021-11-055 edits

OLE DB (Object Linking and Embedding, Database) is an API developed by Microsoft for accessing many kinds of data stored in a uniform way. It is a set of interfaces added using the Component Object Model (COM) and is unrelated to Object Linking and Embedding. It was designed as a higher-level replacement for, and successor to, ODBC, and extends its features to support a wider range of non-relational databases, such as object databases and spreadsheets that do not necessarily implement SQL.

OLE DB separates the data store from the application, which must access it through a set of abstractions that include the data source, session, command, and rowset. This is because different applications need to access many kinds and sources of data without needing to know how they work technically. OLE DB is conceptually divided into consumers and providers. A consumer is an application that needs to access data, and a provider is a software component that adds the interface. In this way, data is delivered to the consumer. OLE DB is part of the Microsoft Data Access Components (MDAC) stack. MDAC is a collection of Microsoft technologies that, as a framework, helps them interact together and gives programmers a uniform and comprehensive way to access almost any data store. OLE DB providers can be created so that simple data stores such as text files and spreadsheets can be accessed through complex databases such as Oracle, SQL Server, and Sybase ASE. They can also provide access to hierarchical data stores such as e-mail systems.

However, because different storage technologies offer different capabilities, an OLE DB provider may not add every interface available in OLE DB. The available capabilities can be added by using COM objects. An OLE DB provider maps the data storage technology's capabilities to specific COM interfaces. Microsoft describes interfaces as being available provider-specific. This means they may not apply depending on the underlying database technology. Providers can, however, extend the capabilities of the data store, and these capabilities are known as services in the Microsoft environment.

Invalid Operation Exception

Description of System.invalidoperationexception in OLE DB.

Consider the following scenario.

  • You have a Windows Form application in Microsoft Visual Studio 2005 on a computer running a 64-bit version of Windows Vista.
  • You create a DataGridView control. Then you bind the DataGridView control to a Microsoft Access database.
  • You run the application.

In this scenario, you may receive the following error message.

System.invalidoperationexception을 발생 했습니다.
메시지 = "'Microsoft.Jet.OLEDB.4.0' 공급자는 로컬 컴퓨터에 등록 되지 않았습니다."
Source="System.Data"

This exception occurs because there is no 64-bit version of the Microsoft.Jet.OLEDB.4.0 database provider.

  • Method 1: Force the application to compile as a 32-bit application.
  • Method 2: Use Microsoft SQL Server Express Edition instead of Access.

Steps for Method 1 for a Microsoft Visual C# project.

  1. In Solution Explorer, right-click the application, and then click Properties.
  2. Click the Build tab.
  3. Click X 86 in the Platform target list.
  4. On the File menu, click Save Selected Items.

See also

Favorite site

author Zer0 sitemap