Access Object Model - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

Access Object Model

Description:

1. Access Object Model. 11-15-2005. 2. ADO. ActiveX Data Objects. Communicates with the MS DB engines. Mediator between Access Application layer and the DB engine ... – PowerPoint PPT presentation

Number of Views:71
Avg rating:3.0/5.0
Slides: 15
Provided by: scie246
Category:
Tags: access | activex | model | object

less

Transcript and Presenter's Notes

Title: Access Object Model


1
Access Object Model
  • 11-15-2005

2
ADO
  • ActiveX Data Objects
  • Communicates with the MS DB engines
  • Mediator between Access Application layer and the
    DB engine layer
  • DAO and ADO contain their own objects, methods,
    properties and events

3
ADO
  • Much simpler
  • Move versatile
  • Enables communications between a wide range of
    applications and DB engines
  • OLD DB providers

4
ADO Extensions
  • ADOX
  • ADO manages data retrieval and manipulation tasks
  • ADOX handles design and security tasks

5
Hierarchy
  • ADO
  • Table 6.1
  • Figure 6.2
  • ADOX
  • Table 6.2
  • Figure 6.3

6
Recordset Object
  • Main purpose of ADO
  • Provides access to the data
  • Primary way to manipulate the data
  • Dim rs as ADODB .Recordset
  • Set rs new ADODB.Recordset
  • rs.open

7
RecordSet Details
  • Cursor
  • A device that is used to traverse the records in
    a recordset
  • Locktype
  • Key property
  • Indicates the type of lock placed on the records
    during editing

8
Recordset Properties
  • BOF/EOF
  • Beginning/end of file
  • Fields
  • Returns the Fields collection
  • MaxRecords
  • Limits the number of records
  • RecordCount
  • Number of records

9
Recordset Methods
  • AddNew
  • Add new record
  • Delete
  • Deletes one or more records
  • GetRows
  • Retrieves multiple records into an array
  • Move, MoveFirst, MoveNext,
  • Moves the curor

10
Field Object
  • Represents a field in a record
  • Properties
  • Name
  • Value
  • Type

11
Looping Through a Recordset
  • Dim rst as New ADODB.Recordset
  • Dim cnn as New ADODB.Connection
  • Set cnn CurrentProject.Connection
  • Rst.Open Employees, cnn
  • Do until rst.EOF
  • Debug.print rst!LastName
  • rst.MoveNext
  • loop

12
Forms Code
  • Northwind MDB
  • C\Program Files\Microsoft Office\OFFICE11\SAMPLES
  • Add Suppliers
  • VBA
  • Customer Labels Dialog
  • Macro
  • Customer Phone List
  • Radio buttons
  • Properties

13
Build Event
  • Create your own object (button)
  • Expression build
  • Macro builder
  • Code builder

14
Properties Inspector
Write a Comment
User Comments (0)
About PowerShow.com