Objects in Access zGeneral Access objects zData access objects (DAO) yused for data management xdata definition xdata manipulation yused only in code modules.

Slides:



Advertisements
Similar presentations
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 10 – Designing.
Advertisements

VBA Modules, Functions, Variables, and Constants
VBA Data Access Object. Data Access Objects DAO With DAO we can: –Run queries –Update values in database tables –Create structure of databases Tables,
Using Objects and Properties
Arrays-Part 1. Objectives Declare and initialize a one-dimensional array Store data in a one-dimensional array Display the contents of a one-dimensional.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 8 Arrays.
CIS 338: Using DAO (Data Access Objects) Dr. Ralph D. Westfall February, 2003.
CIS 451: ASP Recordsets Dr. Ralph D. Westfall May, 2002.
1 Chapter 8 Object-Based Programming in VBA. 8 Chapter Objectives Declare and use object variables Create procedures that use built-in form methods Find.
User-defined Data Types VB provides programmers with the ability to create user-defined types. User-defined Types are collections of related variables.
Manipulating Strings.
CORE 2: Information systems and Databases STORAGE & RETRIEVAL 2 : SEARCHING, SELECTING & SORTING.
© 1999, by Que Education and Training, Chapter 11, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
Microsoft Access Ervin Ha.
ADO Recordsets. Recordset Objects Similar to Tables and Queries: data Using VBA/VBScript you… –Open a recordset, –Locate a record –Update or add a record.
Private Sub Close_Click() On Error GoTo Err_Close_Click DoCmd.Close Exit_Close_Click: Exit Sub Err_Close_Click: MsgBox Err.Description Resume Exit_Close_Click.
Handling of data from multiple databases. Visual Basic Database Visual Basic application acts as a front-end to the database Visual Basic application.
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
Microsoft Access Using Visual Basic Routines. Visual Basic Datatypes Boolean Byte Currency Date Double Integer Long Object Single String Variant Hyperlink.
A few slides on MS Access Record Locking and Transactions.
Computer Science 101 Database Concepts. Database Collection of related data Models real world “universe” Reflects changes Specific purposes and audience.
Copyright © 2001 by Wiley. All rights reserved. Chapter 9: Introduction to Working with Databases in Visual Basic Database Concepts Relational Database.
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
Recordsets Chapter 7. Recordset Objects Similar to Tables and Queries: data But forms cannot be bound to them Fields cannot be bound to them But Access.
ADO 2.5 Kamaljit Bath, Program Manager Data Access Group.
You can use Access forms to create an interface to your reports and queries. You can add: Buttons to initiate reports and queries Combo Boxes, List.
Introduction: Databases By Margaret Lion 1. What is a database? A collection of data organized to serve many applications efficiently by centralizing.
What’s new in ADO 2.5 Greg Hinkel Program Manager Data Access Group
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.
PL/SQLPL/SQL Oracle10g Developer: PL/SQL Programming Chapter 3 Handling Data in PL/SQL Blocks.
What have we learned?. What is a database? An organized collection of related data.
26 Mar 04 1 Application Software Practical 5/6 MS Access.
There are seven main components of a database in Access 2000: Tables. Use tables to store database information. Forms Use forms to enter or edit the information.
1 DBS201: Introduction to Structure Query Language (SQL) Lecture 1.
Python Arrays. An array is a variable that stores a collection of things, like a list. For example a list of peoples names. We can access the different.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
3/18: Microsoft Access Refresher: What is a relational database? Why use a database? Sample database in MS access. –Fields, records, attributes. –Tables,
Oracle10g Developer: PL/SQL Programming1 Objectives SQL queries within PL/SQL Host or bind variables The %TYPE attribute Include queries and control structures.
Database Management System. DBMS A software package that allows users to create, retrieve and modify databases. A database is a collection of related.
1 MS Access. 2 Database – collection of related data Relational Database Management System (RDBMS) – software that uses related data stored in different.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Unbound Form Form not tied directly to any fields in the database Must use SQL to “bind” the fields 1.
Oracle11g: PL/SQL Programming Chapter 3 Handling Data in PL/SQL Blocks.
2/20: Ch. 6 Data Management What is data? How is it stored? –Traditional management storage techniques; problems –DBMS.
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
CS130 Visual Basic Project 4 Lecture Fall New topics in project 4 Database, file (table), records, fields. Application that contains menus, submenus,
ECMM6018 Enterprise Networking For Electronic Commerce Tutorial 6 CGI/Perl and databases.
Understanding Visual Basic Fundamentals CHAPTER 13 Understanding Visual Basic Fundamentals.
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.
Linked list: a list of items (nodes), in which the order of the nodes is determined by the address, called the link, stored in each node C++ Programming:
3.1 CSC 102 Introduction to Information Systems Databases.
VOCAB REVIEW. A field that can be computed from other fields Calculated field Click for the answer Next Question.
Chapter 11.  Large amounts of data are often stored in a database—an organized collection of data.  A database management system (DBMS) provides mechanisms.
Lecture 4 Manipulating Form Data using methods of Recordset and RecordsetClone in VBA Restrict data with filter 1 Rapid Application Development.
SERIALIZED DATA STORAGE Within a Database James Devens (devensj)
Data Access Objects .
ActiveX Data Objects (ADO)
Listing 9.1 ShowLocalConnection.aspx
Using Access to Implement a Relational Database
List Based Objects.
Objectives In this chapter, you will: - Learn about records (structs) - Examine operations on a struct - Manipulate data using a struct - Learn about the.
List Based Objects.
Introduction to Databases
Handling Data in PL/SQL Blocks
Unit – V Data Controls.
Presentation transcript:

Objects in Access zGeneral Access objects zData access objects (DAO) yused for data management xdata definition xdata manipulation yused only in code modules

Commonly Used Data Access Objects

Using DAO zUsing the current database  declare an object variable of type Database  use the CurrentDb function to store a reference to the current database yexample Dim dbs As Database Set dbs = CurrentDb( )

Using DAO zLooping through collections  uses For Each statement, similar to a For Next loop yexample Dim dbs As Database Dim conTest As Container Set dbs = CurrentDb() For Each conTest In dbs.Containers Debug.Print “Container: “; conTest.Name Next

Using DAO  Recordsets yrecords belonging to a table or query ymost commonly used types xtable-type xdynaset-type xsnapshot-type

Using DAO  Table-type recordsets  default type for any recordset object ycan use indexes to speed up the process of searching for records yexample Dim rec As Recordset Set rec = db.OpenRecordset(“Students”)

Using DAO  Dynaset-type recordsets ycan contain a table or the result of a query ycan be edited and the results will be reflected in the underlying tables  useful if the recordset object is very large yexample Set rec = db.OpenRecordset(“Students”, dbOpenDynaset)

Using DAO  Snapshot-type ynot updateable yexample Set rec = db.OpenRecordset(“Students”, dbOpenSnapshot)

Using DAO Moving through recordsets

Using DAO  RecordsetClone method yalternative to OpenRecordset method ycreates copy of recordset that can be manipulated independently of the form’s recordset  Bookmark property ywhat Access uses instead of record numbers ystored as an array of bytes yused to synchronize recordset objects which are clones of each other

Using DAO  Finding records in table-type recordsets  Seek method used with indexed fields xselect indexed field to search on xspecify search criteria xexample rec.Index = “Price” rec.Seek “=“, curPrice

Using DAO zFinding records in dynasets and snapshots  Find method  Works on non-indexed fields for all types of recordsets yFour methods xFindFirst xFindLast xFindNext xFindPrevious

Using DAO Methods to edit recordsets

Using DAO  Editing field values in a recordset yexample rec.Edit rec!strField = NewValue rec.Update

Using DAO  With … End With ylogic structure often used with DAOs, but can be used with controls and collections