ADO 2.5 Kamaljit Bath, Program Manager Data Access Group.

Slides:



Advertisements
Similar presentations
The Hierarchical Model
Advertisements

Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
Introduction to Database Processing with ADO.NET.
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
ActiveX Data Object ISYS 562. ADO An ActiveX control ActiveX is build upon COM, a contract that defines a standard interface by which objects communicate.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall COS 346 Day 23.
Fundamentals, Design, and Implementation, 9/e COS 346 DAY 22.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
CIS 451: ASP Recordsets Dr. Ralph D. Westfall May, 2002.
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
WORKING WITH FILES, MENUS AND DATABASES IN VISUAL BASIC BY V. V. SUBRAHMANYAM.
SQL Server 2000 and XML Erik Veerman Consultant Intellinet Business Intelligence.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Databases and LINQ Visual Basic 2010 How to Program 1.
DAVID M. KROENKE’S DATABASE PROCESSING, 10th Edition © 2006 Pearson Prentice Hall 12-1 David M. Kroenke’s Chapter Twelve: ODBC, OLE DB, ADO, and ASP Part.
Programming with Visual Basic.NET An Object-Oriented Approach  Chapter 8 Introduction to Database Processing.
Introduction to ADO By David R. Stevenson Consulting Software Engineer ABB Automation.
Using the Select Case Statement and the MsgBox Function (Unit 8)
Database 20/2/12 Connection. 
Handling of data from multiple databases. Visual Basic Database Visual Basic application acts as a front-end to the database Visual Basic application.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Simple Database.
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
Numeric Variables Visual Basic for Applications 6.
Databases and Data Access  Introduction to ADO.NET  ADO.NET objects  ADP.NET namespaces  Differences between ADO and ADO.NET.
Lesson 17 Getting Started with Access Essentials
Universal Data Access and OLE DB. Customer Requirements for Data Access Technologies High-Performance access to data Reliability Vendor Commitment Broad.
Faculty of Electronic Engineering 1 Database Access API’s Aleksandar Stanimirović Leonid Stoimenov Aleksandar Milosavljević.
Visual Basic ADO Programming 56:150 Information System Design.
Oracle Data Integrator Procedures, Advanced Workflows.
What’s new in ADO 2.5 Greg Hinkel Program Manager Data Access Group
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
ActiveX Data Objects (ADO) is Microsoft’s latest database object model. The goal of ADO is to allow VB developers to use a standard set of objects to refer.
Tutorial 91 Databases A database is an organized collection of related information stored in a file on a disk A database allows companies to store information.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
CSCI 3327 Visual Basic Chapter 13: Databases and LINQ UTPA – Fall 2011.
Microsoft FrontPage 2003 Illustrated Complete Integrating a Database with a Web Site.
JAVA BEANS JSP - Standard Tag Library (JSTL) JAVA Enterprise Edition.
Lab 8 Data Access Using Microsoft ActiveX Data Object (ADO)
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
5-1 VISUAL J++ Colorado Technical University IT420 Tim Peterson.
Database Connectivity with ASP.NET. 2 Introduction Web pages commonly used to: –Gather information stored on a Web server database Most server-side scripting.
What’s new in ADO 2.5 Greg Hinkel Program Manager Data Access Group
What’s new in ADO 2.5 Greg Hinkel Program Manager Data Access Group
1 CS 3870/CS 5870: Note07 Prog 4. Master Pages Creating a master page based on another master page MainMasterPage –For all Progs and Tests Prog4MasterPage.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
ASP-14-1 Advanced ASP Techniques Colorado Technical University IT420 Tim Peterson.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
ASP-13-1 Recordsets Colorado Technical University IT420 Tim Peterson.
1 ADO Activex Data Objects. 2 ADO ADO allows users to access data easily from many existing databases (such as Access or Paradox) From ODBC compliant.
Presentation on Database management Submitted To: Prof: Rutvi Sarang Submitted By: Dharmishtha A. Baria Roll:No:1(sem-3)
Preface IIntroduction Course Objectives I-2 Course Content I-3 1Introduction to Oracle Reports Developer Objectives 1-2 Business Intelligence 1-3 Enterprise.
Generating XML Data from a Database Eugenia Fernandez IUPUI.
ASP.NET Programming with C# and SQL Server First Edition
INTRODUCTION TO DATABASES (MICROSOFT ACCESS)
Introduction to Database Processing with ADO.NET
Visual Basic 2010 How to Program
VBA - Excel VBA is Visual Basic for Applications
Data Model.
What’s new in ADO Greg Hinkel Program Manager Data Access Group
Unit – V Data Controls.
Presentation transcript:

ADO 2.5 Kamaljit Bath, Program Manager Data Access Group

Agenda  ADO - Overview  Semi-structured Data  ADO Programming Model  URL binding for ADO Objects  Record Object  Relationship between Record and Recordset  Stream Object  Summary

ADO Overview  A single, powerful consumer interface for data exposed by OLE DB providers  Designed for use in Web-based and Client/Server applications  Supports all languages (Visual Basic ®, Visual C++ ®, Visual J++ ™, Visual Basic Scripting Edition)  High Performance  Simple Object Model

Semi-structured data  Data that is:  More structured than a BLOB  Less structured than a Recordset or a relational database table  Examples:  A file system  data  An arbitrary XML stream  Web pages  Etc.

Semi-structured data: Characteristics  Data tends to be organized hierarchically, like a tree  Hierarchies have arbitrary depth  Each node in the tree has a set of properties  Each node may have a unique set of properties  Leaf-nodes associated with a special “Value” property  Non-leaf nodes are collections of other nodes

Semi-structured data: Requirements  Node Operations  Get/Set properties, Add/Delete properties  Scoped Operations  Move, Copy, Delete operations apply to all contained nodes  Querying  A list of nodes that satisfy a predicate on properties  Lightweight  Operations such as reading properties, etc. are done many times

ADO Design Goals  Keep it simple!  Allow ADO objects to be addressed by URL strings  Extend ADO to work with tree-structured & hierarchical datasources  Provide the ability to do scoped operations  Extend ADO so that it may be used to read and manipulate binary streams

Modeling semi-structured data with ADO 2.5  Collections are modeled as recordsets  Common properties are modeled as fields of the recordset  Folders, Directories  Nodes are modeled as a record object  Properties are modeled as fields of the record object  Files, folder objects  Contents of nodes are manipulated by the Stream object

ADO Object Model Connection Command Recordset Errors Fields Parameters

ADO Object Model Connection Command Recordset Errors Fields Parameters RecordStream

URL Naming for ADO objects  URLs can be used to directly identify individual objects in a datasource  nodes in a hierarchical namespace (files and folders)  table in a relational database, unique rows in a table  Record object represents a unique object  file, folder, table, row  Recordset object represents the contents of a collection object  rows of a table, files in a folder

URL binding to ADO objects  ADO 2.5 allows URL naming for  Connection, Recordset, Record, and Stream objects  For a Recordset, URL must point to a collection type node  For stream, URL must point to a node that has a default stream defined  Hides RootBinder/ProviderBinder objects from the developer  New record objects can also be created directly

URL naming - sample code Sub RsOpen() Dim cn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim rs1 as New ADODB.Recordset cn.Open " rs1.Open “mysubfolder”, cn rs.Open " _ adOpenForwardOnly, _ adLockReadOnly, _ adCmdURLBind End Sub

Record Object (1 of 2)  New automation object implemented in ADO 2.5  Models an entity that has a collection of properties and (possibly) nested entities  , Files, web pages, structured documents, folders, XML node, Databases, Tables, etc.  can also represent a row of a recordset  /File contents appear as a stream property

Record Object (2 of 2)  Expresses the notion of containment & scoping  Folders contain other folders  Folder operations such as move, copy, etc. apply within the folder’s scope  Properties are modeled as a collection of Fields  Containment is modeled as Sub-Records  Child records can be viewed in a tabular form as a recordset  Properties and methods are implemented to operate on the record object

Opening a Record Object   Many ways to open a record object   Open directly using a URL string that uniquely identifies it   From an ADO recordset by specifying an individual record   From a field’s value property  Record object always exists in the context of a Connection object  connection object is either implicitly created or explicitly specified

Record Properties

Record Methods (1 of 2) Open ([Source as variant], [ActiveConnection as variant], [Mode as ModeEnum = adoModeUnknown], [CreateOptions as RecordCreateOptionsEnum = -1], [OpenOptions as RecordOpenOptionsEnum = -1], [uid as string], [pwd as string])

Record Methods (2 of 2) CopyRecord ({SourceURL as string], DestURL as string, [destuid as string], [destpwd as string], [CopyRecordOptions as CopyRecordOptionsEnum], [AsyncFlag as Boolean]) as String GetChildren() as ADODB.Recordset

Working with the Record Object ‘opens an existing record object or creates a new one Sub OpenFolderIfExists() Dim rec As New ADODB.Record Dim rs as ADODB.Recordset rec.Open " _ adOpenIfExists|adCreateCollection adOpenIfExists|adCreateCollection Debug.Print "Record is Collection : " & Str(rec.RecordType) rec.MoveRecord “TestSubFolder”, “yourfolder” Set rs = rec.GetChildren End Sub

Fields of a Record object  A field represents a property associated with a record object  Title, size, modified time of a file, folder, message  Fields are implemented as a collection on the record object  Methods and properties are same as that on recordset’s field object  New fields can be added to the collection of an already open record object

The Recordset Object  When a record is a collection (such as a folder), it has other records contained in it  A view of contained records is available as a recordset  tabular view as opposed to the tree view  Use GetChildren method on the Record object  opens the default contents recordset - pre-defined schema for document source providers  Execute a command against a folder  Ability to search on properties  Use Record and Recordset for navigation  URL is one of the fields on the contents recordset & can be used to open the contained records

Recordsets with Variable # of Columns  Many data sources generate recordsets where each row has a different set of columns  Case in point: Contents of a mail folder  An folder has different properties from the Contacts folder  Case in point: An XML stream  Each element may have a different set of attributes  Case in point: The Contents recordset  Each file in a folder has different set of properties

Supporting Variable Column Recordsets  The fields collection on the recordset contains the set of “common” fields  From address, subject, receive date, etc. for  File name, size, last modified, etc. for files  Each record has a set of fields unique to that row  This is a superset of the common columns that exist for the recordset  To view the variable fields, obtain a record object from the recordset and then use its fields collection

Relationship between the Record & Recordset Objects  Record’s field collection  Superset of the fields collection on the associated source recordset, if any  It is possible to add/delete fields from an already open record object  only for fields that are unique to that record  Record behaves in the same update mode as its source recordset  if no source recordset, then in immediate update mode

Working with the Recordset Object 'open Recordset Sub OpenRecordset() Dim rs As New ADODB.Recordset Dim rec As New ADODB.Record Dim cn As New ADODB.Connection stSrc = " rs.Open stSrc,, _ adOpenForwardOnly, _ adLockReadOnly, _ adCmdURLBindrs.MoveNext rec.Open rs End Sub

Working with the Fields collection Sub RSFields() Dim rs As New Recordset Dim rec as new Record stURL = " rs.Open stURL,,,, adCmdURLBind while rs.eof <> True rec.Open rs For i = 0 To rec.Fields.Count - 1 Debug.Print rec.fields(I).name, “=“, _ rec.fields(I).value rec.fields(I).value Next I rs.MoveNextWend End Sub

Stream Object  A new ADO 2.5 object  An automation object used to manipulate the contents of a binary/textual stream  Implemented on top of IStream interface  Record objects usually have a default stream associated with them  content of an message, default document for a web folder  BLOB/Text fields in a database may also be viewed as a stream object

Stream Properties

Stream Methods (1 of 3) Open ([Source as variant], [Mode as ModeEnum = adoModeUnknown], [Options as StreamOpenOptionsEnum = adOpenFromURL], [uid as string], [pwd as string])

Stream Methods (2 of 3) ReadText ([NumChar as long = adReadAll]) as String WriteText (StrChars as string, [Options as StreamWriteOptionsEnum = adWriteChar])

Stream Methods (3 of 3) CopyTo(destStream as stream, [NumChars as integer = -1]) LoadFromFile (strFileName as string) SaveToFile(FileName as string, [SaveOptions as SaveOptionsEnum = adSaveCreateNotExist])

Working with the Stream object Sub StmOperations() Dim Stm as New ADODB.Stream stURL = " Stm.Open stURL Debug.Print Stm.Size Debug.Print Stm.Type Debug.Print Stm.ReadText Stm.SaveToFile “c:\my documents\copyofmydoc.doc” End Sub

ADO Summary  Extends core ADO to work with semi- strucutred data exposed by new datasources  Enables web-publishing and document management through scripting languages  Shipping in MDAC 2.5 with Windows 2000  Will be available in Beta3