ActiveX Data Objects: Difference between revisions

Content deleted Content added
Lots of changes
Line 1:
Microsoft '''ADO''' (ActiveX Data Objects''' (ADO) is a set of [[Component objectObject modelModel]] objectobjects for accessing data sources. It provides a layer between [[programming language]]s and [[OLE DB]] (a means of accessing data stores, whether they be [[databasesdatabase]]s or otherwise, in a uniform manner), which allows a developer to write programs which access data, without knowing how the database is implemented. You must be aware of your database for connection only. No knowledge of [[SQL]] is required to access a database when using ADO, although one can use ADO to execute arbitrary SQL commands. The disadvantage of this is that this introduces a dependency upon the type of database used.
 
It is positioned as a successor to Microsoft's earlier object layers for accessing data sources, including [[Remote Data Objects|RDO]] (Remote Data Objects) and [[Data Access Objects|DAO]] (Data Access Objects). ADO was introduced by [[Microsoft]] in the winter of [[1996]].
 
ADO consists of several top-level objects:
Line 15:
*Property (stores information about objects)
 
The ADO componentcomponents are isusually used in conjunction with a high-level language, such as [[VBScript programming language|VBScript]] in an [[Active Server Pages|ASP]] (ASP) environment, or [[Visual Basic]]. EvenHowever, languages such as [[Borland Delphi|Delphi]], aand [[C++ Builder]], development environmentenvironments from Microsoft rival [[Borland|Borland Software Corporation]] Coporation, nowalso allowsallow the use of ADO to access various databases.
 
In the newer programming framework of .NET, [[Microsoft]] also presented an upgraded version of ADO called [[ADO.NET]]. Its object structure is quite different from that of traditional ADO. Traditional ADO is still very popular, and is often perceived as being more mature.
Line 24:
set myconnection = server.createobject("ADODB.Connection")
set myrecordset = server.createobject("ADODB.Recordset")
 
myconnection.open mydatasource
myrecordset.open "Phonebook", myconnection
myrecordset.find "PhoneNumber = '555-5555'"
Line 33:
set myrecordset = nothing
set myconnection = nothing
 
This is equivalent to the following ASP code, which uses plain SQL, instead of the functionality of the Recordset object:
 
dim myconnection, myrecordset, name