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 consists of several top-level objects:
ADO is used in conjunction with a high-level language, such as VBScript in an ASP environment. Here 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) myrecordset.close
set myrecordset = nothing set myconnection = nothing
Search Encyclopedia
|
Featured Article
|