Content deleted Content added
→See also: Add wikilink to ActiveX |
|||
(17 intermediate revisions by 15 users not shown) | |||
Line 1:
{{Short description|Component Object Model APIs for accessing data sources}}
{{Use mdy dates|date=January 2019}}
{{Use American English|date=January 2019}}
{{no footnotes|date=February 2013}}
In [[computing]], [[Microsoft]]'s '''ActiveX Data Objects''' ('''ADO''') comprises a set of [[Component Object Model]] (COM) [[object (computing)|object]]s for accessing data sources. A part of [[Microsoft Data Access Components|MDAC]] (Microsoft Data Access Components), it provides a [[middleware]] layer between [[programming language]]s and [[OLE DB]] (a means of accessing data stores, whether
Microsoft introduced ADO in October 1996, positioning the software as a successor to Microsoft's earlier object layers for accessing data sources, including [[Remote Data Objects|RDO]] (Remote Data Objects) and [[Jet Data Access Objects|DAO]] (Data Access Objects).
Line 34 ⟶ 37:
: A recordset is a group of records, and can either come from a base table or as the result of a query to the table. The RecordSet object contains a Fields collection and a Properties collection. The Fields collection is a set of Field objects, which are the corresponding columns in the table. The Properties collection is a set of Property objects, which defines a particular functionality of an OLE DB provider. The RecordSet has numerous methods and properties for examining the data that exists within it. Records can be updated in the recordset by changing the values in the record and then calling on the Update or UpdateBatch method.
; Immediate
: The recordset is locked using the adLockOptimistic or
; Batch
: The recordset is locked using adLockBatchOptimistic and each time Update is called the data are updated in a temporary buffer. Finally, when UpdateBatch is called the data are completely updated back at the data source. This has the advantage of it all being done in memory, and if a problem occurs then UpdateCancel is called and the updates are not sent to the data source.
Line 44 ⟶ 47:
: A stream, mainly used in a RecordSet object, is a means of reading and writing a stream of bytes. It is mostly used to save a recordset in an XML format, to send commands to an OLE DB provider as an alternative to the CommandText object and to contain the contents of a binary or text file.
; Parameter
: A parameter is a means of altering the behaviour of a common piece of functionality, for instance a [[stored procedure]] might have different parameters passed to it depending on what needs to be done; these are called parameterised commands.
; Field
: Each Record object contains many fields, and a RecordSet object has a corresponding Field object also. The RecordSet object's Field object corresponds to a column in the database table that it references.
Line 65 ⟶ 68:
=== ASP example ===
Here is an [[Active Server Pages|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")
Line 80 ⟶ 83:
set myrecordset = nothing
set myconnection = nothing
</syntaxhighlight>
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")
Line 89 ⟶ 92:
set myrecordset = myconnection.execute("SELECT Name FROM Phonebook WHERE PhoneNumber = '555-5555'")
name = myrecordset(0)
</syntaxhighlight>
==Software support==
ADO is supported in any development language that supports binding to binary COM interfaces. These languages include ASP, [[
==Legacy==
Line 100 ⟶ 103:
* [[ADO.NET]]
* [[Comparison of ADO and ADO.NET]]
* [[ActiveX]]
* [[MSDAIPP]]
==References==
Line 106 ⟶ 111:
==External links==
* [http://msdn2.microsoft.com/en-us/library/ms805098.aspx Microsoft ADO page]
* [http://www.connectionstrings.com/ Database connection strings] {{Webarchive|url=https://web.archive.org/web/20210126200223/https://www.connectionstrings.com/ |date=January 26, 2021 }}
* [http://www.devguru.com/content/technologies/ado/home.html DevGuru ADO Quick Reference]
{{Microsoft APIs}}
{{Authority control}}
{{DEFAULTSORT:Activex Data Objects}}
[[Category:Microsoft application programming interfaces]]
[[Category:Data access technologies]]
|