ODBC (Open Database Interconnection): An early Database interface technology introduced by Microsoft. It is actually the predecessor of ADO. Early database connectivity is very difficult. Each database has a different format, and developers have a deep understanding of the underlying APIs for each database they develop. As a result, generic APIs that can handle a wide variety of databases have emerged. The current ODBC (Open Database Connectivity), ODBC is an early product of people creating generic APIs. There are a number of databases that comply with this standard and are called ODBC-compliant databases.
OLE DB (object link and embedded database) is located between the ODBC layer and the application. In your ASP page, ADO is an "application" located above OLE DB. Your ADO call is sent to OLE DB before it is processed by ODBC. You can connect directly to the OLE DB layer, and if you do, you'll see a performance boost for server-side cursors (the default cursors of the recordset and the most commonly used cursors).
To connect to a database with ODBC:
There are three types of DSNs available in ODBC, and the difference is simple: a user DSN can only be used for this user. The difference between a System DSN and a file DSN is only that the connection information is stored in a different location: The System DSN is stored in an ODBC storage area, and the file DSN is placed in a text file.
The way they are created is not said.
When using them in ASP, the following are written:
A.sql Server:
Using the system dsn:connstr= "DSN=DSNNAME;" Uid=xx; Pwd=xxx;database=dbname "
Use the document Dsn:connstr= "FILEDSN=XX; Uid=xx; Pwd=xxx;database=dbname "
You can also use a connection string (thereby eliminating the need to create a DSN):
Connstr= "Driver={sql SERVER}; Server=servername; Uid=xx; Pwd=xxx "
B.access:
Using the system dsn:connstr= "Dsn=dsnname"
(or for: connstr= "dsn=dsnname; Uid=xx; Pwd=xxx ")
Dsn:connstr= "Filedsn=xx" with file
You can also use a connection string (thereby eliminating the need to create a DSN):
Connstr= "Driver={microsoft Access DRIVER};D Bq=d:\abc\abc.mdb"
To connect to a database with OLE DB:
A.sql Server:
Connstr= "PROVIDER=SQLOLEDB;
DATA Source=servername; Uid=xx; Pwd=xxx;database=dbname "
B.access:
Connstr= "Provicer=microsoft. JET. oledb.4.0;
DATA Source=c:\abc\abc.mdb "
It is noteworthy that OLE DB compatibility with ODBC allows OLE DB to access existing ODBC data sources. The advantages are obvious because ODBC is more commonly used relative to OLE DB, so you can get more ODBC drivers than OLE DB. This does not necessarily mean that the driver for the OLE DB can be accessed without immediate access to the original data system.
The provider is located 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, and it will then use the appropriate ODBC driver. If you do not need to use an ODBC data source, you can use the appropriate OLE DB providers, which are often referred to as local providers (native provider).
It is clear that using an ODBC provider means that an additional layer is required. Therefore, when accessing the same data, the OLE DB Provider for ODBC may be slower than the local OLE DB provider.