1 / 12

ADO & Recordsets

ADO & Recordsets. 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

armen
Download Presentation

ADO & Recordsets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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

  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.

More Related