|
Microsoft ADO (ActiveX Information Objects) occurs as Component object model object for accessing data sources. It will bring the layer between programming languages and OLE DB (a means of accessing information places, whether it exist as databases or otherwise, in a uniform manner), which allows the creator to write software which access information, forgoing caring how else the database is implemented. Professional people must become caring of the database for connection single. There is no noesis of SQL is required to access the database once applying Hustle, although 1 might have Bustle to execute arbitrary SQL commands. a disadvantage of this is that this introduces a dependency upon the database.
These are placed as a successor to Microsoft's earliest object shells for accessing information sources, including RDO (Remote Data Objects) & DAO (Data Access Objects). Fuss was introduced by Microsoft in the wintertime of 1996.
Hustle consists of many top-level objects:
Connection (is a connection to the database)
Recordplaced (is the set of database records)
Command (is the SQL command)
Record (is the placed of information, generally from either the source otherwise the database)
Stream (is water of information, when from either the document or even webpage)
Error (places errors)
Field (is the database field)
Parameter (is the SQL parameter)
Property (places data just about objects)
Fuss component is utilized within conjunction by using the high-level language, like VBScript in an Active Server Pages (ASP) environment, or Visual Basic. Potentially Delphi, a development environment from either Microsoft rival Borland Coporation, now allows a utilize of Flurry to access various databases.
In the fresh programming framework of .NET, Microsoft also present an upgraded version of ADO known as ADO.NET. Its object structure is quite different from either that of traditional Bustle. Traditional ADO is however super popular, & is typically perceived when existence supplementary matured.
On this text is an ASP lesson applying Fuss to choose a "Name" field, from either the table known as "Phonebook", in which the "PhoneNumber" was capable "555-5555".
dim myconnection, myrecordset, name
placed myconnection = server.createobject("ADODB.Connection")
placed myrecordset = server.createobject("ADODB.Recordset")
myconnection.open mydatasource
myrecordset.open "Phonebook", myconnection
myrecordset.buy "PhoneNumber = '555-5555'"
title = myrecordset.fields.item("Name")
myrecordset.close
placed myrecordset = nothing
placed myconnection = nothing
This is same to the charted ASP code, which utilizes evidently SQL, instead of the functionality of the Recordset object:
dim myconnection, myrecordset, name
placed myconnection = server.createobject("ADODB.connection")
myconnection.open mydatasource
placed myrecordset = myconnection.execute("SELECT Name FROM Phonebook WHERE PhoneNumber = '555-5555'")
title = myrecordset(Nought)
myrecordset.close
placed myrecordset = nothing
placed myconnection = nothing
|