|
Microsoft's ActiveX Data Objects (ADO) is a set of Component Object Model (COM) objects for accessing data sources. It provides a layer between programming languages and OLE DB (a means of accessing data stores, whether they be databases or otherwise, in a uniform manner). ADO allows a developer to write programs that 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 (i.e. using SQL directly) is that it 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 RDO (Remote Data Objects) and DAO (Data Access Objects). ADO was introduced by Microsoft in October 1996.
InternalsADO consists of several top-level objects:
The ADO components are usually used in conjunction with a high-level language such as VBScript in an ASP environment or Visual Basic. However, languages such as Delphi and C++ Builder, development environments from Microsoft rival Borland Software Corporation, also allow 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. Basic UsageSome basic steps are required in order to be able to access and manipulate data using ADO :
ASP ExampleHere is an ASP example using ADO to select the "Name" field, from a table called "Phonebook", where a "PhoneNumber" was equal to "555-5555". dim myconnection, myrecordset, name set myconnection = server.createobject("ADODB.Connection") set myrecordset = server.createobject("ADODB.Recordset") myconnection.open mydatasource myrecordset.open "Phonebook", myconnection myrecordset.find "PhoneNumber = '555-5555'" name = myrecordset.fields.item("Name") myrecordset.close 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 set myconnection = server.createobject("ADODB.connection") myconnection.open mydatasource set myrecordset = myconnection.execute("SELECT Name FROM Phonebook WHERE PhoneNumber = '555-5555'") name = myrecordset(0) Software supportADO is supported in ASP, PowerBuilder, and in VBA for Office. See alsoExternal links
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License.
Mercedes Car
This site monitored by SitePinger.net