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.

Slides:



Advertisements
Similar presentations
Basics of Database Programming with VB6
Advertisements

ADO DB in Access VBA © Walter Milner 2005 Slide: 1 ADO VBA Programming in Access.
Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Fundamentals, Design, and Implementation, 9/e Chapter 12 ODBC, OLE DB, ADO, and ASP.
The ADO Data Control. Universal Data Access Open Database Connectivity (ODBC) –standard for accessing data in databases OLE-DB –allows access to data.
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 Objects and Properties
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.
Web-based Programming Lanjut Pertemuan 6 Matakuliah: M0492 / Web-based Programming Lanjut Tahun: 2007.
Programming the RecordSet Object
 2004 Tau Yenny, SI - Binus M0194 Web-based Programming Lanjut Session 6.
Database Connectivity Session 2. Topics Covered ADO Object Model Database Connection Retrieving Records Creating HTML Documents on-the-fly.
VB.NET Database Access ISYS 812. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
Visual Basic Database Access BICS546. Microsoft Universal Data Access OLE DB: The OLE database protocol –Allows a program to access information in any.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab10 Interacting with Data (Database Management)
Database Programming (using ADO) Universal Data Access – Microsoft strategy for providing access to information across the enterprise. – UDA provides high-performance.
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.
ASP & ADO. Connection Object An implicit connection is created when we open a recordset without a connection object. –rs.open “Customer”, "DSN = Sales”
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
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.
1 ODBC, OLE DB, ADO, and ASP. 2 Introduction  Because database applications today reside in a complicated environment, various standards have been developed.
Chapter 11 Introduction to Database Processing. Class 11: Database Processing Use a Visual Studio Wizard to establish a database connection used to load.
Chapter 7 PHP Interacts with Ms. Access (Open DataBase Connectivity (ODBC))
ActiveX Data Object (ADO) in JavaScript J.L.Wang, Yen-Cheng Chen Dept. of Infomation Management Ming-Chuan University Jan
1 VBScript Session What we learn last session?
Introduction to ADO By David R. Stevenson Consulting Software Engineer ABB Automation.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Database actions In this presentation… –database actions –database connections –recordsets.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 11 Accessing Database.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Copyright © 2001 by Wiley. All rights reserved. Chapter 9: Introduction to Working with Databases in Visual Basic Database Concepts Relational Database.
Lecture Note 10: Simple Database Techniques. Introduction –Database System –Access, SQL Server and others. –Microsoft Access - Interacting with this databases.
Visual Basic ADO Programming 56:150 Information System Design.
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
How to Connect to Database ODBC (Open Database Connectivity) ADO (ActiveX Data Object) ASP Code To Connect to Database Recordset Object Navigating through.
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.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Chapter 9 Building the Shopping cart Objective Creating Shopping cart using session Variable. Creating a shopping cart using a database table. Use the.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
DEV383 The ADO.NET DataSet and You Jackie Goldstein General Manager Renaissance Computer Systems
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
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.
ADO ActiveX Data Object. ActiveX Data Objects (ADO) is Microsoft’s latest database object model. The goal of ADO is to allow VB developers to use a standard.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Source = Table rsObject.Open tablename, Connection Object, CursorType, LockType, adCmdTable Source = Stored Procedure rsObject.Open stored procedure name,
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 6: Accessing a database with PHP Rob Gleasure robgleasure.com.
7-1 Active Server and ADO Colorado Technical University IT420 Tim Peterson.
ASP-13-1 Recordsets Colorado Technical University IT420 Tim Peterson.
ADO & Recordsets. ADO Description & History  ActiveX Data Objects  History  1991 ODBC  Data Access Objects (DAO) for VB developers (JET)  Remote.
Using databases ActiveX Data Objects (ADO) Connecting to a database Reading data from a database Inserting, updating and deleting records Using databases.
ADO .NET from. ADO .NET from “ADO .Net” Evolution/History of ADO.NET MICROSOFT .NET “ADO .Net” Evolution/History of ADO.NET History: Most applications.
Generating XML Data from a Database Eugenia Fernandez IUPUI.
 2 Data Object Library approaches ◦ DAO (Data Access Objects)  Original access strategy (up to VB6)  Closely linked to MS Access ◦ ADO (ActiveX Data.
ASP.NET Programming with C# and SQL Server First Edition
Visual Basic Database Access
Data Access Objects .
Find, filter etc with connection to Access code internally
ActiveX Data Objects (ADO)
The Recordset Object.
INT213 Updating the Database.
VISUAL BASIC INTRODUCTION TO DATA CONNECTIVITY.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Chapter 10 ASP and Data Store Access
Database Objects 1/12/2019 See scm-intranet.
Chapter 10 ADO.
Working With Databases
Presentation transcript:

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 databases like Oracle or MS SQL Server. Provide flexible database front ends to users that are reliable

3

4 ADO Object Model

5 Connection Object Represents an open connection to the data source. Connection can be a local connection (say App.Path) or can be across a network in a client server application.

6 Cont… A connection object establishes a connection to a data provider and data source. – Connections have an isolation mode. Once a connection is created, it can be used to create RecordSet and Command objects.

7 Connection Object Properties ConnectionString-Defines in string form the location of the data source E.g. driver={SQL Server} server= bigsmile; uid=sa;pwd=pwd;database=pubs Provider-A string defining the provider of a connection object (the type of database to be connected) E.g. Provider=Microsoft.Jet.OLEDB.4.0 for Microsoft access

8 Cont… Mode- permissions for modifying data across the open connection. Read Write Read/Write various Share/Deny types. CursorLocation- location of the cursor engine can be client-side or server side

9 Connection Object Methods Close - Closes an open connection. Open - Opens a connection with the settings in the ConnectionString property.

10 Recordset Object The RecordSet object represents a complete set of records from an executed command or from an underlying base table in the database. RecordSet object references only one record at a time as the current record

11 Recordset Object Properties CursorLocation - This sets or returns the location of the cursor engine for the database. The options are client side and server side CursorType- Sets the cursor type. Which determines when and to whom database changes are immediately visible to.

12 Cursor Types adOpenForwardOnly – default- Changes made by others not visible adOpenKeyset-Number of records never changes, Records deleted by others are not accessible, Records added by others not visible,Updates made by others is notified adOpenDynamic- Notifications of additions, Deletions and Updations are received, Expensive in terms of memory and speed adOpenStatic-Changes made by others not visible

13 Cont… EOF and BOF - End Of File and Beginning Of File. When at the first record of an open RecordSet BOF will be true, when at the last EOF will be true. Fields - Returns a collection of the field objects for an open record set. Database fields can be accessed by – their name using the RecordSet!FieldName schema, – by their index RecordSet.Fields(intIndex) – sometimes by their name from the fields collection RecordSet.Fields("FieldName").

14 Cont… LockType – adLockReadOnly - No Updates allowed on the data fetched by the recordset – adLockPessimistic-Locks the record as soon as we edit it,Some providers may not support this – adLockOptimistic - Locks the record only when we update the record, Supported by all providers – adLockBatchOptimistic - Update a batch of records locally and then send it to server, Not all providers support this

15 Recordset Object Methods AddNew Close MoveNext MoveFirst MoveLast MovePrevious Open Update

16 Command Object A command object specifies a specific method you intend to execute on or against the data source accessed by an open connection.

17 Command Object Properties ActiveConnection - Defines the Connection object the command belongs to. CommandText -Contains the text of the command to be executed against a data source. Can be – a table name – a valid SQL string – the name of a stored procedure in the data source.

18 Cont… CommandType - Defines the type of the command. The three most commonly used would be – adCmdText – adCmdTable – adCmdStoredProc.

19 Command Object method Execute -Executes the query, SQL statement, or stored procedure specified in the CommandText property and returns a RecordSet object.

20 ADO Error Object An Error Object contains details about data access errors to a single operation involving provider ADO errors are trapped in On Error event

21 ADO Reference

22 Putting It All Together Using ADO is a three step process – Define and open a Connection to a data source – Decide what data is needed from the data source and define Command objects that will retrieve this data. – Retrieve the data required by executing the command objects and manipulate the data using RecordSet objects