Presentation is loading. Please wait.

Presentation is loading. Please wait.

ADO & Recordsets. ADO Description & History  ActiveX Data Objects  History  1991 ODBC  Data Access Objects (DAO) for VB developers (JET)  Remote.

Similar presentations


Presentation on theme: "ADO & Recordsets. ADO Description & History  ActiveX Data Objects  History  1991 ODBC  Data Access Objects (DAO) for VB developers (JET)  Remote."— Presentation transcript:

1 ADO & Recordsets

2 ADO Description & History  ActiveX Data Objects  History  1991 ODBC  Data Access Objects (DAO) for VB developers (JET)  Remote Data Object (RDO) SQL, Oracle, etc (ODBC)  ODBCDirect utilizing RDO  OLE DB – ADO is a wrapper for OLE DB  High level, object oriented interface  Intended to replace DAO and RDO.

3 The ADO Object Model

4 The Connection Object  Represents link to the data source  Directly execute statements against source  Manage transactions  Expose events to notify of completed tasks  Provides Error object/collection  ADO does not require Connection object, but it is highly beneficial to declare explicitly.

5 The Recordset Object  Supports data paging  Disconnected recordsets  Filtering  Sorting  Storing multiple data sets in a single object

6 Recordsets and ASP VBScript  Creating a Connection object  Recordset samples  Executing action queries  Cursors  Locks

7 Connection Object  Microsoft Access Example  Microsoft SQL Server Example

8 Recordset Example  http://www.jeonglee.com/ado http://www.jeonglee.com/ado

9 Cursors  Determines how you can move through the recordset  Determines properties and methods made available through recordset object  Can only be specified upon opening a recordset  Specify it using.CursorType property in recordset object or as the third parameter using.Open method  Performance considerations

10 Cursors  Adopenforwardonly (Value 0) Default  The data is alive but you can only move forward.  Cannot move backward or to specific record  Adopenkeyset (Value 1)  The data is alive and any record read will be the most recent data.  Adopendynamic (Value 2)  The data is alive and additions will be noticed.  Accurate recordcount.  Adopenstatic (Value 3)  The data is dead. It is like a snapshot of the data.  Accurate recordcount.

11 Locks  Data modification and concurrency  Choice of locking depends on business rules

12 Locks  AdLockReadOnly (Value 1) Default  Read-only recordset, no locking provided since data cannot be updated.  AdLockPessimistic (Value 2)  Attempts to lock record once editing starts.  AdLockOptimistic (Value 3)  Only locks the record when.Update method is used.  AdLockBatchOptimistic (Value 4)  Locks are issued when.UpdateBatch method is used.


Download ppt "ADO & Recordsets. ADO Description & History  ActiveX Data Objects  History  1991 ODBC  Data Access Objects (DAO) for VB developers (JET)  Remote."

Similar presentations


Ads by Google