Chapter 8 Relational Databases ActiveX Database Controls 8 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.

Slides:



Advertisements
Similar presentations
Basics of Database Programming with VB6
Advertisements

Exploring Microsoft Access 2003 Chapter 5 One-to-Many Relationships : Subforms and Multiple Table Queries.
Copyright © 2008 Pearson Prentice Hall. All rights reserved Committed to Shaping the Next Generation of IT Experts. Exploring Microsoft Office Access.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
 Open the Paradise.exe file  Application displays records in the Books database  Allows the store manager to enter an author’s name (or part of a name)
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Exploring Microsoft Access 2003 Chapter 6 Many-to-Many Relationships: A More Complex System.
Exploring Office Grauer and Barber 1 Tables and Forms: Properties, Views, and Wizards(Wk3)
Exploring Microsoft Access 2003 Chapter 1 Introduction to Microsoft Access: What Is A Database?
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Microsoft Access 2003 Introduction To Microsoft Access 2003.
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.
FIRST COURSE Access Tutorial 2 Building a Database and Defining Table Relationships.
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.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 1 1 Microsoft Access 2003 Tutorial 1 – Introduction To Microsoft Access 2003.
Some Basic Database Terminology
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
With Microsoft Access 2007 Volume 1© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Access 2007 Volume 1 Chapter.
Advanced Forms Lesson 10.
Handling of data from multiple databases. Visual Basic Database Visual Basic application acts as a front-end to the database Visual Basic application.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Appendices A - F A-F Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 11 Accessing Database.
Exploring Office Grauer and Barber 1 Introduction to Access: What is a Database?(Wk1)
® Microsoft Office 2013 Access Building a Database and Defining Table Relationships.
Exploring Microsoft Access Chapter 4 Relational Databases, External Data, Charts, and the Switchboard.
Microsoft Access 2003 Define some key Access terminology: Field – A single characteristic or attribute of a person, place, object, event, or idea. Record.
Copyright © 2001 by Wiley. All rights reserved. Chapter 9: Introduction to Working with Databases in Visual Basic Database Concepts Relational Database.
CHAPTER EIGHT Accessing Data Processing Databases.
McGraw-Hill/Irwin ©2009 The McGraw-Hill Companies, All Rights Reserved Business Driven Information Systems 2e Plug-In T6: Basic Skills and Tools Using.
Exploring Microsoft Access 97 Chapter 1 Introduction to Microsoft Access: What Is A Database? Office graphic copyright by Microsoft Corp.
© 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 9 – Building Links,
Microsoft Access 2013 Simplify Data Entry with Forms Chapter 3.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
File Processing Concepts – Field – combination of 1 or more characters that is the smallest unit of data to be accessed – Record – group of related fields.
Key Applications Module Lesson 21 — Access Essentials
© 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 2 – Viewing and.
® Microsoft Office 2010 Building a Database and Defining Table Relationships.
Copyright 2007, Paradigm Publishing Inc. ACCESS 2007 Chapter 2 BACKNEXTEND 2-1 LINKS TO OBJECTIVES Creating Related Tables Creating Related Tables Determining.
Exploring Microsoft Access Chapter 6 Many-to-Many Relationships: A More Complex System.
1 Committed to Shaping the Next Generation of IT Experts. Chapter 1- Introduction to Access: What is a Database? Robert Grauer and Maryann Barber Exploring.
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.
Chapter 7 Database Basics Tables, Records, and Fields 7 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
XP Chapter 2 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Building The Database Chapter 2 “It is only the farmer.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
1/62 Introduction to and Using MS Access Database Management and Analysis Yunho Song.
Chapter Thirteen Working with Access Databases and LINQ Programming with Microsoft Visual Basic th Edition.
AVCE ICT – Unit 7 - Programming Session 16 – Database and VB.
Microsoft Office 2013: In Practice Chapter 2 Using Design View, Data Validation, and Relationships Copyright © 2014 by The McGraw-Hill Companies, Inc.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Exploring Office Grauer and Barber 1 One-to-Many Relationships: Subforms and Multiple-Table Queries(Wk7)
1 11 Exploring Microsoft Office Access 2007 Chapter 6 Data Protection.
CPSC 203 Introduction to Computers T97 By Jie (Jeff) Gao.
MSOffice Access Microsoft® Office 2010: Illustrated Introductory 1 Part 1 ® Database & Table.
Exploring Microsoft Access Chapter 5 One-to-Many Relationships: Subforms and Multiple Table Queries.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
XP Chapter 1 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Level 2 Objectives: Understanding and Creating Table.
Copyright © 2014 Pearson Canada Inc. Ext. 5b-1 Copyright © 2014 Pearson Canada Inc. Application Extension 5b Using Microsoft Access Part 2: Using Information.
Visual Basic Database Access
Microsoft Access 2016 Simplify Data Entry with Forms
VISUAL BASIC INTRODUCTION TO DATA CONNECTIVITY.
Exploring Microsoft Access 2003
Working With Databases
Chapter 10 Accessing Database Files
Unit – V Data Controls.
Chapter 7 Database Basics
Presentation transcript:

Chapter 8 Relational Databases ActiveX Database Controls 8 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.2 Objectives Basic terminology such as tables and relationships 2. Use controls specialized for databases such as the data control, data-bound list box, data-bound combo box, and data- bound grid 3. Differences between FlexGrid control and data-bound grid control

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.3 Objectives 4. Implement a front-end application for an existing Access database 5. Use Visual Data Manager 6. Create a new database application with Application Wizard 7. Create new forms with the Data Form Wizard

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.4 Overview  Access is the relational database program included with Office Professional Edition  Minimize code using data-bound controls  Use standard ActiveX controls and the FlexGrid control

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.5 Relational Databases... Relational databases - composed of tables and relationships Table - consists of rows of records and columns of fields Relationship - association between fields in two tables one-to-one one-to-many many-to-many

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.6 Relational Databases... Primary key - field(s) that uniquely determines a record in a database Foreign key - used to defined relationships between tables - a field in a table that also serves as a primary key in another table

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.7 Birthday Access Database Birthdays Table Occupations Table Primary Key Foreign Key

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.8 Database Controls... Data control - use for each table we want to work with in the database Data control Properties DatabaseName property - path and filename of the existing database RecordSource property - select from the list of tables in the database

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.9 Birthday Access Database Data Control for the Occupations Table Data Control for the Birthdays Table

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.10 ActiveX Database Controls... Data-bound list control - displays a list box using a database field Data-bound combo control - displays combo box using a database field Data-bound grid control - displays a grid using a database field(s)

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.11 ActiveX Database Controls...  Properties to set before utilizing Row Source List Field Text  Properties used to update and manage the database Data Source Data Field Bound Column

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.12 ActiveX Database Controls  Properties must be set in order to work correctly 1) Row Source 2) List Field 3) Text Property 4) Data Source 5) Data Field 6) Bound

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.13 Database Tools Picture Label Text box Combo box Check box List box Data Image OLE container DBListDBGrid DBCombo

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.14 More Properties  Data-bound Grid Control Data Source property  Intrinsic Data-Aware Control Properties Data Source property Data Field property

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.15 Birthday Database Using Access Hands-On Exercise 1 Create project, then add and edit forms Add the Data control Edit the module code Edit and verify the Main form code Test the Splash and Main forms Add another Data control, and a Data-bound combo box Test the Data-bound combo control

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.16 Managing and Displaying Records Recordset - a record(s) selected from a table(s) in a database Table recordsets - limited to a single table, and can modify records Dynaset recordsets - can be used for multiple tables, and can modify records Snapshot recordsets - can be used for multiple tables, but cannot modify records

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.17 Navigating Records with Data Control Methods Name.Recordset.Method Where Name is the name of the data control Method is one of the following: MoveFirst moves to the first record MovePrevious moves to the previous record MoveNext moves to the next record MoveLast moves to the last record Example: datBirthdays.Recordset.MoveFirst

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.18 Finding Records with the Data Control Name.Recordset.Method Where Name is the name of the data control Method is one of the following: FindFirst finds the first record FindPrevious finds the previous record FindNext finds the next record FindLast finds the last record Example: datBirthdays.Recordset.FindFirst “LastName = Dion”

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.19 Adding and Deleting Records with the Data Control Name.Recordset.Method Where Name is the name of the data control Method is one of the following: AddNew adds a new record to the end of the database Refresh redisplays the current record Update modifies the fields in the current record Delete deletes the current record from the database Close closes the recordset, and frees the memory allocated for storage Example: datBirthdays.Recordset.AddNew

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.20 Finish the Birthday Access Project Hands-On Exercise 2 Edit the Module code Test the Add Record and Delete Record code Add code and test the Find Record button and procedure Modify the List form and add the Grid controls Test the List form

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.21 More Database Tools...  Different ways to access data ActiveX Data Objects (ADO) Remote Data Objects (RDO) Data Access Objects (DAO)

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.22 More Database Tools Learning Edition Tools ActiveX database controls Intrinsic data-aware controls Professional Edition Tools Data View windows (new to VB 6.0) Data Environment Design Data Report feature Enterprise Edition Tools Query Designer Database Designer

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.23 Add-Ins Add-ins: tools that are programs that customize and extend the Visual Basic environment 1) Add-ins: generic term 2) Builders: helps view or set control properties 3) Wizards: leads a user step-by-step through a task 4) Utilities: add-in that may be run outside Visual Basic

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.24 Visual Data Manager Add a Field Remove a Field

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.25 Visual Data Manager and the Birthday Database Hands-On Exercise 3 Create a new project & new database Create a new table and add fields Add a record to the database Use the Application Wizard Use the Data Form Wizard Finish the Application Wizard Test the Update form and the Grid form

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.26 Summary...  Access included with Microsoft Office Professional Edition  Relational databases composed of several tables and relationships  Relationships established between two tables using a foreign key

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.27 Summary...  ActiveX database controls include Data-bound list box Data-bound combo box Data-bound grid control FlexGrid control  Data control must be used for each table we want to access

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.28 Summary...  Navigate database using recordsets Table recordset Dynaset recordset Snapshot recordset  Define new databases using the Visual Data Manager add-in included in all 3 editions of Visual Basic

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.29 Summary  Data Form Wizard (new with VB 6.0) helps create database forms  Application Wizard creates general forms such as Splash and About forms for applications

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.30 Practice with Visual Basic 1. Demonstration: Data Browser Program 2. Sample Program: Bibliography Database Browser 3. Demonstration: Music Review Notepad 4. Personal Address Book 5. Access Demo 6. Access Demo Front End

Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc.31 Case Studies  Relational Database Design  Database Design Implementation  Access Office VB Advisor  Universal Access Web Site