Basics of Database Programming with VB6

Slides:



Advertisements
Similar presentations
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Advertisements

Chapter 12: Using ADO.NET 2.0 Programming with Microsoft Visual Basic 2005, Third Edition.
The ADO Data Control. Universal Data Access Open Database Connectivity (ODBC) –standard for accessing data in databases OLE-DB –allows access to data.
ActiveX Data Object ISYS 562. ADO An ActiveX control ActiveX is build upon COM, a contract that defines a standard interface by which objects communicate.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Introduction to ADO.Net, VB.Net Database Tools and Data Binding ISYS 512.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
Database Connectivity Session 2. Topics Covered ADO Object Model Database Connection Retrieving Records Creating HTML Documents on-the-fly.
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)
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Database Programming (using ADO) Universal Data Access – Microsoft strategy for providing access to information across the enterprise. – UDA provides high-performance.
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.
Microsoft Access 2010 Chapter 7 Using SQL.
Overview of Database Access in.Net Josh Bowen CIS 764-FS2008.
Chapter 8 Relational Databases ActiveX Database Controls 8 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
Microsoft Access Ervin Ha.
Access Tutorial 10 Automating Tasks with Macros
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
An INTRODUCTION to MICROSOFT ACESS 2000 By Dr. Ennis-Cole.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 1 – Access Basics.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
ASP.NET Programming with C# and SQL Server First Edition
Introduction to ADO.Net and Visual Studio Database Tools ISYS 512.
Advanced Database Management System Lab no. 11. SQL Commands (for MySQL) –Update –Replace –Delete.
Chapter 7 PHP Interacts with Ms. Access (Open DataBase Connectivity (ODBC))
ActiveX Data Object (ADO) in JavaScript J.L.Wang, Yen-Cheng Chen Dept. of Infomation Management Ming-Chuan University Jan
Jaeki Song JAVA Lecture 11 Java Database Connectivity.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Using Visual Basic 6.0 to Create Web-Based Database Applications
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 11 Accessing Database.
Microsoft Office Access 2003 Số tiết: 30 tiết lý thuyết 60 tiết thực hành Giáo viên: Từ thị Xuân Hiền.
Copyright © 2001 by Wiley. All rights reserved. Chapter 9: Introduction to Working with Databases in Visual Basic Database Concepts Relational Database.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
Microsoft Access You will need a pen/pencil.. What is Microsoft Access? Access is a database management system.  Create a database, add/change delete.
Lecture Note 10: Simple Database Techniques. Introduction –Database System –Access, SQL Server and others. –Microsoft Access - Interacting with this databases.
Visual Basic ADO Programming 56:150 Information System Design.
Key Applications Module Lesson 21 — Access Essentials
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
How to Connect to Database ODBC (Open Database Connectivity) ADO (ActiveX Data Object) ASP Code To Connect to Database Recordset Object Navigating through.
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.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 25.1 Test-Driving the ATM Application 25.2.
Presentation On How To Create Connection To A Database.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
AVCE ICT – Unit 7 - Programming Session 16 – Database and VB.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
Lesson 13 Databases Unit 2—Using the Computer. Computer Concepts BASICS - 22 Objectives Define the purpose and function of database software. Identify.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 6: Accessing a database with PHP Rob Gleasure robgleasure.com.
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.
DATABASE SYSTEM VB LINK TO MS-SQL. 2 Visual ProgrammingChapter 6 Select Project -> Component.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Programming with Microsoft Visual Basic 2012 Chapter 14: Access Databases and SQL.
 2 Data Object Library approaches ◦ DAO (Data Access Objects)  Original access strategy (up to VB6)  Closely linked to MS Access ◦ ADO (ActiveX Data.
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
VB 2010 Pertemuan 10.
Microsoft Access 2013 Bobby Wan.
The Recordset Object.
VISUAL BASIC INTRODUCTION TO DATA CONNECTIVITY.
Chapter 10 ASP and Data Store Access
Accessing Databases with ADO.NET, Handling Exceptions, and Printing
Working With Databases
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

Basics of Database Programming with VB6 By: Mr. Carl Michael L. Morados

What is a database? Database – a collection of related data or information, that is stored, modified and transmitted. Personal Info Student Database Payments Grades

Structure of a Database Tables – collection of related information Records –single piece of information Fields – smallest unit of information that is useful to users.

Structure of a Database Record Student Information Sheet Name: Address: Contact No.: Fields Table

Visual Basic and Database Front End – the user interface, which the program uses to interact with the user. Back End – the database, where all data coming from the user are saved, to be retrieved later.

Visual Basic and Database Database Driver ADO Object The user interacts with the program by user interface or screens. (Database Application) (Visual Basic)

What are database drivers? It allows different programming languages to communicate or get information from different data sources.

Using the ADODC Object ADODC (ActiveX Data Object) – an object used to connect a Visual Basic program to a database. ADODC Object on the toolbox ADODC Object when placed on the form

Inserting the ADODC Object Go to Project menu, then choose Components. (or right click on the toolbox) When the components dialog appears, choose Microsoft ADO Data Control 6.0.

Inserting the ADODC Object Components Dialog Window

Connecting the ADODC to a database Straight Connection Setting of the Database Provider and directly specifying the path of the database (location). Using ODBC (Open Database Connectivity) Creating a Data Source Name (DSN) using the ODBC Administrator of Windows

Steps in Connecting ADODC Right Click on the ADO Object Connect the ADO by using the Connection String or ODBC Data Sources

Steps in Connecting ADODC Choose the correct database provider.

Steps in Connecting ADODC Specify the correct path of the database Test the connection if the ADODC where able to communicate with the data source.

Steps in Connecting ADODC Specify how the ADODC will connect to the table.

Structure of an ADODC commands <adodc name>.RECORDSET.<method> The Name of the adodc object Refers to the table object Methods that can be done to a table

Types of ADODC methods Record Operations Addnew – used to add records to the table. Delete – used to delete records from the table. Update – used to save records to the table. CancelUpdate – cancels any record-related operations.

Types of ADODC commands Record Navigation Find <parameters> - used to find or search records, based on key fields. Movefirst – go to the first record. Movelast – go to the last record. Movenext – go to the next record. Moveprevious – go to the previous record. Move(record no.) – go to a specified record no.

Types of ADODC commands Record Counters RecordCount – returns the number of records on the table EOF – End of File, returns True if the record pointer reaches the end of the table. BOF – Beginning of File, returns True if the record pointer reaches the beginning of the table

Finding Records FIND “[key field] like ‘comparing value’ e.g. adoSTUD.RECORDSET.FIND “[LName] like ‘Locsin’” In finding records, always REFRESH the table first. to complete the code: adoSTUD.REFRESH

Using the SQL Statements SQL (Structured Query Language) – is composed of series of statements and clauses, which, when combined, perform different actions. Select Queries – returns a specific set of records, based on criteria Action Queries – performs actions such as deleting, adding or updating records.

Basic Structure of Select SELECT <fields> FROM <tablename> [<where> <condition> <order by>] e.g. Select * from StudInfo