Wednesday, August 4, 2010

Working With Connection and Data Source


ADO: Active X data object provides an application level interface to the data provider like SQL Server 2000/ 2005 and Access. ADO is directly used in ASP pages to communicate with such databases.
ADO gives developers a powerful, logical object model for programmatically accessing, editing, and updating data from a wide variety of data sources.
The most common usage of ADO is to query a table or tables in a relational database, retrieve and display the results in an application, and perhaps let users make and save changes to the data. Other tasks include the following: 


  •  Querying a database using SQL and displaying the results.
  •  Saving data from a database into an XML file.
  •  Executing commands described with XML and retrieving an XML stream.
  •  Saving data into a binary or XML stream.
  •  Allowing a user to review and change data in database tables.
  •  Creating and reusing parameterized database commands.
  •  Executing stored procedures
OLEDB: Object Linking and Embedding, Database, sometimes written as OLEDB or OLE-DB provides a system level interface to the data provides like SQL Server 2000/2005 and Access. OLEDB is never used directly into the ASP pages instead ADO is used as a higher level interface of OLEDB.

ODBC : ODBC is designed for maximum interoperability - that is, the ability of a single application to access different database management systems (DBMSs) with the same source code.
 ODBC VS OLEDB

ODBC is a specification devised by Microsoft and other companies, primarily for handling SQL data across multiple platforms.

OLE DB is a COM-based technology designed not only for SQL database access, but access to any other kind of data through which a company gives access by writing an OLE DB provider. A provider is a piece of software conforming to the OLE DB specification that is called by the user to do work with the data. By having a common set of routines to provide access to SQL and non-SQL data, OLE DB gives you more flexibility in where your data comes from.

If you are working with straight SQL databases, either ODBC or OLE DB will do fine. In some case, OLE DB performance has been clocked slightly better than ODBC. An advantage of ODBC is that the MFC database classes are based on ODBC, and other platforms support ODBC. OLE DB is almost exclusively a Windows technology since it relies on COM, and very few non-Windows platforms have COM support now. 

If all you need is SQL access and you aren't familiar with COM, then stick with ODBC. If you're writing for the Windows platform, are familiar with COM, and want some of the OLE DB features that ODBC doesn't provide, and then go with OLE DB.

No comments:

Post a Comment