In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail what is the difference between OLEDB and ODBC. The content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
1. Single beam driver
The single-beam driver is between the application and the database, and the data provides a unified way of data access like the intermediary driver. When the user performs a database operation, the application passes an ODBC function call to the ODBC driver manager, and the ODBC API determines whether the call is handled directly by it and whether the result is returned or sent to the driver for execution and return the result. As can be seen from the above, the single-beam driver itself is a database engine that can directly complete the operation of the database, although the database may be located anywhere on the network.
two。 Multi-beam driver
The multi-beam driver, which is responsible for transferring commands and data between the database engine and the client application, is itself an interface of a network communication protocol used for remote operations without performing data processing operations. The front-end application makes a request for database processing, which is transferred to the ODBC driver manager, and the driver manager completes or transmits the request to the multi-beam driver locally according to the situation of the request. The multi-beam driver translates the request into a form that can be understood by the database communication interface of a specific manufacturer (such as Oracle's SQLNet) and hands it over to the interface, which transmits the request to the data engine on the server through the network. After processing, the server sends the results back to the database communication interface, and the database interface transmits the results to the multi-beam ODBC driver, and then the driver transmits the results to the application.
ODBC (Open Database Interconnection) is an early database interface technology introduced by Microsoft. It is actually the predecessor of ADO. Early database connections were very difficult. The format of each database is different, and developers have to have a deep understanding of the underlying API of each database they develop. Therefore, the general API which can handle all kinds of databases arises at the historic moment. Now known as ODBC (Open Database Connectivity), ODBC is an early product of people creating a universal API. There are many databases that comply with this standard and are called ODBC-compliant databases.
OLEDB (object linking and embedding database) is located between the ODBC layer and the application. In your ASP page, ADO is an application on top of OLEDB. Your ADO call is sent to OLEDB and then handed over to ODBC for processing. You can connect directly to the OLEDB layer, and if you do, you will see an improvement in the performance of server-side cursors (recordset's default and most commonly used cursors).
Reference http://www.connectionstrings.com/
Connect to the database using odbc:
There are three kinds of dsn available in odbc, and the difference between them is simple: the user dsn can only be used by this user. The only difference between system dsn and file dsn is that the connection information is stored in a different location: the system dsn is stored in the odbc storage area, while the file dsn is stored in a text file.
Let's not talk about how they were created.
When using them in asp, write them as follows:
1.sql server:
Use the system dsn: connstr= "DSN=dsnname; UID=xx; PWD=xxx;DATABASE=dbname"
Use the file dsn:connstr= "FILEDSN=xx;UID=xx; PWD=xxx;DATABASE=dbname"
You can also use a connection string (so that you no longer have to create a dsn):
Connstr= "DRIVER= {SQLSERVER}; SERVER=servername;UID=xx;PWD=xxx"
2.access:
Use the system dsn: connstr= "DSN=dsnname"
(or: connstr= "DSN=dsnname;UID=xx;PWD=xxx")
Use the file dsn:connstr= "FILEDSN=xx"
You can also use a connection string (so that you no longer have to create a dsn):
Connstr= "DRIVER= {MicrosoftAccess Driver}; DBQ=d:\ abc\ abc.mdb"
Connect to the database using oledb:
1.sql server:
Connstr= "PROVIDER=SQLOLEDB
DATASOURCE=servername;UID=xx;PWD=xxx;DATABASE=dbname "
2.access:
Connstr= "PROVICER=MICROSOFT.JET.OLEDB.4.0
DATASOURCE=c:\ abc\ abc.mdb "
It is worth noting that OLE DB's compatibility with ODBC allows OLE DB to access existing ODBC data sources. The advantage is obvious, because ODBC is more commonly used than OLE DB, so there are correspondingly more ODBC drivers available than OLE DB. In this way, you don't have to get a driver for OLE DB, so you can access the original data system immediately.
The provider is at the OLE DB layer, and the driver is at the ODBC layer. If you want to use an ODBC data source, you need to use an OLE DB provider for ODBC, which in turn uses the corresponding ODBC driver. If you do not need to use ODBC data sources, you can use the corresponding OLE DB providers, which are often referred to as local providers (native provider).
You can clearly see that using an ODBC provider means that an additional layer is required. Therefore, when accessing the same data, the OLEDB provider for ODBC may be slower than the local OLEDB provider.
ODBC,OLEDB connection string detailed explanation
SQL Server
U ODBC
1. Standard Security:
"Driver= {SQLServer}; Server=Aron1;Database=pubs;Uid=sa;Pwd=asdasd;"
2. Trusted connection:
"Driver= {SQLServer}; Server=Aron1;Database=pubs;Trusted_Connection=yes;"
3. Prompt for username and password:
OConn.Properties ("Prompt") = adPromptAlways
OConn.Open "Driver= {SQL Server}; Server=Aron1;DataBase=pubs;"
U OLE DB, OleDbConnection (.NET)
1. Standard Security:
"Provider=sqloledb;DataSource=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
2. Trusted Connection:
"Provider=sqloledb;DataSource=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
(useserverName\ instanceName as Data Source to use an specifik SQLServer instance,only SQLServer2000)
3. Prompt for username and password:
OConn.Provider= "sqloledb"
OConn.Properties ("Prompt") = adPromptAlways
OConn.Open "Data Source=Aron1;Initial Catalog=pubs;"
4. Connect via an IP address:
"Provider=sqloledb;DataSource=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;UserID=sa;Password=asdasd;"
(DBMSSOCN=TCP/IPinstead of Named Pipes, at the end of the Data Source is the port to use (1433is the default))
U SqlConnection (.NET)
1. Standard Security:
"DataSource=Aron1;Initial Catalog=pubs;User Id=sa;Password=asdasd;"
-or-
"Server=Aron1;Database=pubs;UserID=sa;Password=asdasd;Trusted_Connection=False"
(bothconnection strings produces the same result)
2. Trusted Connection:
"DataSource=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
-or-
"Server=Aron1;Database=pubs;Trusted_Connection=True;"
(bothconnection strings produces the same result)
(useserverName\ instanceName as Data Source to use an specifik SQLServer instance,only SQLServer2000)
3. Connect via an IP address:
"DataSource=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;UserID=sa;Password=asdasd;"
(DBMSSOCN=TCP/IPinstead of Named Pipes, at the end of the Data Source is the port to use (1433is the default))
About what the difference between OLEDB and ODBC is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.