구글와이드(336x280)_상단 2개


(영문) ActiveX Data Objects (ADO) ASP, ASP.NET

12.2.2- ActiveX Data Objects (ADO)
Posted in 12. ASP and Data Store Access. Not tagged.
<< 12.2.1- What is OLE-DB? Chapter12 12.3.0- What Databases can I use? >>

ActiveX Data Objects (ADO)

You might like to think of the ActiveX Data Objects (ADO) as being the friendly face of OLE-DB. ADO is a set of objects that allow programmers to program their data access logic from languages like Visual Basic as well as scripting languages. ADO is a higher-level model than OLE-DB, which means that it simplifies some of the complexities of programming with OLE-DB. Thus, ADO is much easier to use than OLE-DB.
How does ADO fit into overall structure? The ADO layer sits neatly between the application itself and the OLE-DB layer. In our case, we'll refer to the ADO objects explicitly within the code of our ASP pages, instructing them to read records, update data, and carry out other tasks that relate to the data in our data stores:
543636_pg469.jpg
In this sense, we can think of ADO as being an application programming interface – in our case, it's the interface between our ASP code and the OLE-DB providers. This will becvome more apparent when we see our first examples.
If you've done any database programming in Access or Visual Basic then you'll have come across Data Access Objects (DAO) or Remote Data Objects (RDO). If so, that's OK – in fact, it'll stand you in good stead for ADO, because ADO is a superset of DAO and RDO and is much easier to understand. If not, that's OK too – we'll explain and demonstrate ADO over the course of the next few chapters, and we'll be using it in our ASP pages to access data stores.

ADO and ASP are Different Technologies!

Don't fall into the trap of assuming that ADO is part of ASP, or that it's designed specifically for use with ASP! It's true to say that ADO is the ideal tool to use for achieving data access from ASP pages, and that ADO is shipped as part of the IIS 5.0/ASP 3.0 package. But ADO is more generic than that. If you're planning to write other data-dependent applications, in languages such as Visual Basic, Java or Visual C++, there's nothing to stop you from using ADO in those applications too.
In fact, you can use ADO with any COM-compliant programming language.
So where does ADO come from? In fact, ADO is one of a suite of components, which are known collectively as the Microsoft Data Access Components (or MDAC). This set of components has enjoyed a release schedule that is separate to that of IIS/ASP. You can download the latest version of ADO from Microsoft's web site – at the time of writing, you'll find it at:
The version numbering of MDAC reflects the version numbering of ADO – so that MDAC 2.1 contains ADO 2.1, MDAC 2.0 contains ADO 2.0, an so on. Here's a quick potted history of ADO, and how the availability of different versions relates to the history of ASP:
Product
…was released with…
IIS 3.0
ASP 1.0 and ADO 1.0
IIS 4.0, PWS 4.0
(aka. NT4 Option Pack)
ASP 2.0 and ADO 1.5
Windows 98
PWS 4.0, ASP 2.0 and ADO 1.5
Visual Studio 6.0
ADO 2.0
Office 2000, Internet Explorer 5.0
ADO 2.1
Windows 2000, IIS 5.0
ASP 3.0 and ADO 2.5
ADO has gradually evolved over these releases into the product we'll meet over the next few chapters. The latest release (when the book was printed) – ADO 2.5 – sees the addition of two brand new objects (Record and Stream), which are designed to give us extra capabilities for accessing data stores. (Like ASP and IIS, ADO has had several versions released since the initial book publication. And as ASP became ASP.NET in the next release, ADO became ADO.NET. MDAC 2.8 SP1 is current. It released with Windows Server 2003 with no new features. MDAC 2.7 added support for 64-bit OSs, and MDAC 2.6 exposed several SQL Server 2000 XML features.)
However, the main point to understand is that the object models of ASP and ADO are quite separate. It's important not to consider them as a single package – instead, they should be treated as separate but complementary technologies. ASP enables dynamic web sites, ADO allows you to use data stores as part of a dynamic web site.

The ADO Object Model

Before we start looking in detail at the various parts of data access, let's have a quick look at ADO's object model. This should help us to understand how it all links together as we come to meet the objects individually. We won't go into each object in detail here because we'll be covering them over the course of this chapter and the next two – but this will give a good overall picture:
543636_pg471.jpg
As you can see from the diagram, there are five main objects:
  • Connection – the link between the program and the data store
  • Command – allows you to run commands against the data store
  • Recordset – contains all the data returned from a specific action on the data store
  • Record – allows you to handle data kept in semi-structured storage (such as files in a directory structure) as though they were records in a database
  • Stream – allows the manipulation of data held in web resources, such as HTML files
The five main objects enjoy a "flat" hierarchy – this means that we can create any ADO object we need in our ASP code, without the need to create a hierarchy of parent and grandparent objects. For example, we can use a Recordset object to make a direct request from the data store. In this case, there's no need to create an explicit Connection object in our code first – ADO does the necessary work under the hood.
The five main objects are shaded in the above diagram. There are four subsidiary objects – Property, Parameter, Field and Error (and their associated collections, Properties, Parameters, Fields and Errors). Only three of the four collections are shown. The Properties collection was deliberately left off, so that you can easily see the interaction between the main objects. The relationship between the Properties collection and the other objects is shown here:
543636_pg472.jpg

null



바보들의 영문법 카페(클릭!!)

오늘의 메모....

시사평론-정론직필 다음 카페
http://cafe.daum.net/sisa-1

바보들의 영문법 다음 카페
http://cafe.daum.net/babo-edu/

티스토리 내 블로그
http://earthly.tistory.com/

내 블로그에 있는 모든 글들과 자료에 대한 펌과 링크는 무제한 허용됩니다.
(단, 내 블로그에 덧글쓰기가 차단된 자들에게는 펌, 트랙백, 핑백 등이 일체 허용되지 않음.)

그리고 내 블로그 최근글 목록을 제목별로 보시려면....
바로 아래에 있는 이전글 목록의 최근달을 클릭하시면 됩니다.
그러면 제목을 보고 편하게 글을 골라 보실 수 있습니다.

그리고 내 블로그내 글을 검색하시려면 아래 검색버튼을 이용하시면 됩니다.


가가챗창

flag_Visitors

free counters