SlideShare a Scribd company logo
1 of 26
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...
1. 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
DBList DBGrid
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
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. 16
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. 17
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. 18
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. 19
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. 20
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. 21
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. 22
Visual Data Manager
Add a Field Remove a Field
Exploring MS Visual
Basic 6
Copyright 1999 Prentice-Hall, Inc. 23
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. 24
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. 25
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. 26
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

More Related Content

What's hot

What's hot (20)

Visual Basic 6.0
Visual Basic 6.0Visual Basic 6.0
Visual Basic 6.0
 
SQL Queries Information
SQL Queries InformationSQL Queries Information
SQL Queries Information
 
Html frames
Html framesHtml frames
Html frames
 
Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1Presentation of DBMS (database management system) part 1
Presentation of DBMS (database management system) part 1
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Ms access
Ms accessMs access
Ms access
 
Loops in java script
Loops in java scriptLoops in java script
Loops in java script
 
DATABASE CONSTRAINTS
DATABASE CONSTRAINTSDATABASE CONSTRAINTS
DATABASE CONSTRAINTS
 
Html frames
Html framesHtml frames
Html frames
 
Database management system presentation
Database management system presentationDatabase management system presentation
Database management system presentation
 
HTML: Tables and Forms
HTML: Tables and FormsHTML: Tables and Forms
HTML: Tables and Forms
 
Normal forms
Normal formsNormal forms
Normal forms
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Visual basic
Visual basicVisual basic
Visual basic
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
Database systems introduction
Database systems introductionDatabase systems introduction
Database systems introduction
 
Commands of DML in SQL
Commands of DML in SQLCommands of DML in SQL
Commands of DML in SQL
 
ADO .Net
ADO .Net ADO .Net
ADO .Net
 
Operators
OperatorsOperators
Operators
 

Viewers also liked

Data base connectivity and flex grid in vb
Data base connectivity and flex grid in vbData base connectivity and flex grid in vb
Data base connectivity and flex grid in vbAmandeep Kaur
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)pbarasia
 
Introduction to Project Development using Visual Basic
Introduction to Project Development using Visual BasicIntroduction to Project Development using Visual Basic
Introduction to Project Development using Visual BasicMuralidharan Radhakrishnan
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computersimran153
 
Visual Basic menu
Visual Basic menuVisual Basic menu
Visual Basic menukuldeep94
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverAmmara Arooj
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..cscarcas
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Salim M
 
Chapter 10 Future Directions In Erp A Lexis Leon
Chapter 10 Future Directions In Erp   A Lexis LeonChapter 10 Future Directions In Erp   A Lexis Leon
Chapter 10 Future Directions In Erp A Lexis LeonSonali Chauhan
 
Visual Basic 6 Data Base
Visual Basic 6 Data BaseVisual Basic 6 Data Base
Visual Basic 6 Data BaseSpy Seat
 
Introduction to automated visual testing
Introduction to automated visual testingIntroduction to automated visual testing
Introduction to automated visual testingadamcarmi
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb netZishan yousaf
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deploymenttechbed
 
Erp Alex Leon Chapter 10
Erp Alex Leon Chapter 10Erp Alex Leon Chapter 10
Erp Alex Leon Chapter 10Sonali Chauhan
 
Ky thuat lap trinh nang cao
Ky thuat lap trinh nang caoKy thuat lap trinh nang cao
Ky thuat lap trinh nang caogood food
 

Viewers also liked (20)

Data base connectivity and flex grid in vb
Data base connectivity and flex grid in vbData base connectivity and flex grid in vb
Data base connectivity and flex grid in vb
 
VB6 Using ADO Data Control
VB6 Using ADO Data ControlVB6 Using ADO Data Control
VB6 Using ADO Data Control
 
Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)Presentation on visual basic 6 (vb6)
Presentation on visual basic 6 (vb6)
 
Introduction to Project Development using Visual Basic
Introduction to Project Development using Visual BasicIntroduction to Project Development using Visual Basic
Introduction to Project Development using Visual Basic
 
Visual basic ppt for tutorials computer
Visual basic ppt for tutorials computerVisual basic ppt for tutorials computer
Visual basic ppt for tutorials computer
 
Visual Basic menu
Visual Basic menuVisual Basic menu
Visual Basic menu
 
Database Connection
Database ConnectionDatabase Connection
Database Connection
 
Web based database application design using vb.net and sql server
Web based database application design using vb.net and sql serverWeb based database application design using vb.net and sql server
Web based database application design using vb.net and sql server
 
Introduction to NS2 - Cont..
Introduction to NS2 - Cont..Introduction to NS2 - Cont..
Introduction to NS2 - Cont..
 
Visual basic 6
Visual basic 6Visual basic 6
Visual basic 6
 
Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0Basic controls of Visual Basic 6.0
Basic controls of Visual Basic 6.0
 
Chapter 10 Future Directions In Erp A Lexis Leon
Chapter 10 Future Directions In Erp   A Lexis LeonChapter 10 Future Directions In Erp   A Lexis Leon
Chapter 10 Future Directions In Erp A Lexis Leon
 
Visual Basic 6 Data Base
Visual Basic 6 Data BaseVisual Basic 6 Data Base
Visual Basic 6 Data Base
 
Introduction to automated visual testing
Introduction to automated visual testingIntroduction to automated visual testing
Introduction to automated visual testing
 
Database programming in vb net
Database programming in vb netDatabase programming in vb net
Database programming in vb net
 
7) packaging and deployment
7) packaging and deployment7) packaging and deployment
7) packaging and deployment
 
Timer control
Timer controlTimer control
Timer control
 
Vb 6.0 controls
Vb 6.0 controlsVb 6.0 controls
Vb 6.0 controls
 
Erp Alex Leon Chapter 10
Erp Alex Leon Chapter 10Erp Alex Leon Chapter 10
Erp Alex Leon Chapter 10
 
Ky thuat lap trinh nang cao
Ky thuat lap trinh nang caoKy thuat lap trinh nang cao
Ky thuat lap trinh nang cao
 

Similar to ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book

Off-Label Data Mesh: A Prescription for Healthier Data
Off-Label Data Mesh: A Prescription for Healthier DataOff-Label Data Mesh: A Prescription for Healthier Data
Off-Label Data Mesh: A Prescription for Healthier DataHostedbyConfluent
 
Organizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsOrganizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsAndreas Schreiber
 
Training MS Access 2007
Training MS Access 2007Training MS Access 2007
Training MS Access 2007crespoje
 
DataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data ManagementDataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data ManagementAndreas Schreiber
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsTeamstudio
 
La6 ict-topic-6-information-systems
La6 ict-topic-6-information-systemsLa6 ict-topic-6-information-systems
La6 ict-topic-6-information-systemsKak Yong
 
Chapter2databaseenvironment 120307033742-phpapp01
Chapter2databaseenvironment 120307033742-phpapp01Chapter2databaseenvironment 120307033742-phpapp01
Chapter2databaseenvironment 120307033742-phpapp01Ankit Dubey
 
Electronic Data Processing
Electronic Data ProcessingElectronic Data Processing
Electronic Data ProcessingAnjan Mahanta
 
Database administration
Database administrationDatabase administration
Database administrationsana younas
 
HEPData Open Repositories 2016 Talk
HEPData Open Repositories 2016 TalkHEPData Open Repositories 2016 Talk
HEPData Open Repositories 2016 TalkEamonn Maguire
 
DataFinder concepts and example: General (20100503)
DataFinder concepts and example: General (20100503)DataFinder concepts and example: General (20100503)
DataFinder concepts and example: General (20100503)Data Finder
 

Similar to ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book (20)

Off-Label Data Mesh: A Prescription for Healthier Data
Off-Label Data Mesh: A Prescription for Healthier DataOff-Label Data Mesh: A Prescription for Healthier Data
Off-Label Data Mesh: A Prescription for Healthier Data
 
ch1
ch1ch1
ch1
 
Organizing the Data Chaos of Scientists
Organizing the Data Chaos of ScientistsOrganizing the Data Chaos of Scientists
Organizing the Data Chaos of Scientists
 
Metadata Creation In OBIEE
Metadata Creation In OBIEEMetadata Creation In OBIEE
Metadata Creation In OBIEE
 
Training MS Access 2007
Training MS Access 2007Training MS Access 2007
Training MS Access 2007
 
Access
AccessAccess
Access
 
Chap09
Chap09Chap09
Chap09
 
DataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data ManagementDataFinder: A Python Application for Scientific Data Management
DataFinder: A Python Application for Scientific Data Management
 
Project seminar
Project seminarProject seminar
Project seminar
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
L6-information-systems
L6-information-systemsL6-information-systems
L6-information-systems
 
La6 ict-topic-6-information-systems
La6 ict-topic-6-information-systemsLa6 ict-topic-6-information-systems
La6 ict-topic-6-information-systems
 
L6-information-systems
L6-information-systemsL6-information-systems
L6-information-systems
 
Database Project
Database ProjectDatabase Project
Database Project
 
Informatica training
Informatica trainingInformatica training
Informatica training
 
Chapter2databaseenvironment 120307033742-phpapp01
Chapter2databaseenvironment 120307033742-phpapp01Chapter2databaseenvironment 120307033742-phpapp01
Chapter2databaseenvironment 120307033742-phpapp01
 
Electronic Data Processing
Electronic Data ProcessingElectronic Data Processing
Electronic Data Processing
 
Database administration
Database administrationDatabase administration
Database administration
 
HEPData Open Repositories 2016 Talk
HEPData Open Repositories 2016 TalkHEPData Open Repositories 2016 Talk
HEPData Open Repositories 2016 Talk
 
DataFinder concepts and example: General (20100503)
DataFinder concepts and example: General (20100503)DataFinder concepts and example: General (20100503)
DataFinder concepts and example: General (20100503)
 

Recently uploaded

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 

Recently uploaded (20)

Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 

ADO Controls - Database Usage from Exploring MS Visual Basic 6.0 Book

  • 1. Chapter 8 Relational Databases ActiveX Database Controls 8 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton
  • 2. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 2 Objectives... 1. 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
  • 3. 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
  • 4. 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
  • 5. 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
  • 6. 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
  • 7. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 7 Birthday Access Database Birthdays Table Occupations Table Primary Key Foreign Key
  • 8. 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
  • 9. 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
  • 10. 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)
  • 11. 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
  • 12. 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
  • 13. 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 DBList DBGrid DBCombo
  • 14. 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
  • 15. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 15 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
  • 16. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 16 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
  • 17. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 17 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”
  • 18. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 18 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
  • 19. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 19 More Database Tools... Different ways to access data  ActiveX Data Objects (ADO)  Remote Data Objects (RDO)  Data Access Objects (DAO)
  • 20. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 20 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
  • 21. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 21 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
  • 22. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 22 Visual Data Manager Add a Field Remove a Field
  • 23. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 23 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
  • 24. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 24 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
  • 25. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 25 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
  • 26. Exploring MS Visual Basic 6 Copyright 1999 Prentice-Hall, Inc. 26 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