Database is a collection
of data and objects related to a particular topic or purpose. Database is an
example for data store.In this session we will see how can we use ASP scripting
to access to databases.A Connection links our ASP code to database(or data store).Once
connected to the database we should identify the type of DB.For example , Access
DB is identified by .mdb file.
ODBC
Open Database Connectivity
(ODBC) is a widely accepted application programming interface (API) for database
access. This allowed a programmer to connect a dB using ODBC and manipulate
the data without worrying exactly where the data was stored or what particular
dB was storing it.For example , a user can use same routine to connect to Access
dB or ,SQL Server or, Oracle.
But ODBC has it own disadvantages.It does not allow applications to take advantage
of the special features of individual database. Another thing is that it relies
on relational representation of data. So database specific drivers must be written
to handle the conversion from ODBS based interface to the database specific
routine. But it is hard to develop drivers for nondatabase datasources.
OLEDB is an alternative to ODBC that provides same sort of interface for various
types of datasource ,including nonrelational datasources .
OLE-DB
OLE dB is the fundamental
Component Object Model (COM)-based building block for storing and retrieving
records and unifies Microsoft’s strategy for database connectivity. It will
be used throughout Microsoft’s line of applications and data stores. In OLEDB
dtasource is called data Provider and the client that access the data is called
Consumer.With OLEDB consumers can access the data from data provider directly
or through ODBC provider.
OLE dB defines interfaces for accessing and manipulating all types of data.
These interfaces will be used not just by data-consuming applications but also
by database providers. By splitting databases apart, the resulting components
can be used in an efficient manner. For example, components called service providers
can be invoked to expose more sophisticated data manipulation and navigation
interfaces on behalf of simple data providers. ASP developers can access the
benefits of OLE dB through ActiveX Data Objects(ADO).
ADO
The ActiveX®
Data Objects (ADO) is the object-base interface for accessing all kinds
of data sources. The ADO model strives to expose everything that the underlying
data provider can do, while still adding value by giving you shortcuts for common
operations.It provides a logical set of objects such as Connection
The ADO objects provide you with the fastest, easiest and most productive means
for accessing all kinds of data sources. The objects in this object model are
not depend on one another ie, you can create instance of objects independently
of one another. Older objects models such as Data Access Objects (DAO)
or Remote Data Objects (RDO) are not this flexible. Since there is no hierarchy
and relationship of the objects ,ADO codes is easier to read write and
maintain.
ADO is Microsoft’s
strategic, high-level interface to all kinds of data. ADO provides consistent,
high-performance access to data, whether you’re creating a front-end database
client or middle-tier business object using an application, tool, language,
or even an Internet browser. ADO is the single data interface you need to know
for 1- to n-tier client/server and Web-based data-driven solution development.
ADO is designed as an easy-to-use application level interface to Microsoft’s
newest and most powerful data access paradigm, OLE dB OLE dB provides high-performance
access to any data source, including relational and non-relational databases,
email and file systems, text and graphics, custom business objects, and more.
ADO is implemented with a small footprint, minimal network traffic in key Internet
scenarios, and a minimal number of layers between the front-end and data source-all
to provide a lightweight, high-performance interface. ADO is easy to use because
it is called using a familiar metaphor – the OLE Automation interface, available
from just about any tool and language on the market today. And since ADO was
designed to combine the best features of, and eventually replace RDO and DAO,
it uses similar conventions with simplified semantics to make it easy to learn
for today’s developers.
To see more details
about creating connection see Connection Object