Working With Databases

Slides:



Advertisements
Similar presentations
Basics of Database Programming with VB6
Advertisements

Chapter 10 Excel: Data Handling or What do we do with all that data?
Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
 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)
INSERT BOOK COVER 1Copyright © 2013 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Microsoft Access 2010 by Robert Grauer, Keith Mast,
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Access Tutorial 1 Creating a Database
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:
Access Lecture 1 Database Overview and Creating Tables Create an Employee Table.
Chapter 8 Relational Databases ActiveX Database Controls 8 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Introduction to Access By Mary Ann Chaney and Alicia Harkleroad.
Databases and LINQ Visual Basic 2010 How to Program 1.
Programming with Microsoft Visual Basic 2012 Chapter 13: Working with Access Databases and LINQ.
Chapter 11 Introduction to Database Processing. Class 11: Database Processing Use a Visual Studio Wizard to establish a database connection used to load.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Interacting with Databases Chapter 10. VB and Databases u It is often useful to have a VB program access data stored in a file other than a text file.
Data-mining & Data As we used Excel that has capability to analyze data to find important information, the data-mining helps us to extract information.
Databases. Database A database is an organized collection of related data.
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 Visual Basic 2010: Reloaded Fourth Edition Chapter Twelve Access Databases and LINQ.
® Microsoft Access 2010 Tutorial 1 Creating a Database.
Copyright © 2001 by Wiley. All rights reserved. Chapter 9: Introduction to Working with Databases in Visual Basic Database Concepts Relational Database.
1 Working with MS SQL Server Textbook Chapter 14.
Lecture Note 10: Simple Database Techniques. Introduction –Database System –Access, SQL Server and others. –Microsoft Access - Interacting with this databases.
Access Manual 2 By Dhawala Kovuri Elham S.Khorasani Ismail Guneydas.
USING XML AS A DATA SOURCE. Data binding is a process by which information in a data source is stored as an object in computer memory. In this presentation,
® Microsoft Office 2013 Access Creating a Database.
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.
Databases,Tables and Forms Access Text by Grauer Chapters 1 & 2.
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.
AVCE ICT – Unit 7 - Programming Session 16 – Database and VB.
Planning & Creating a Database By Ms. Naira Microsoft Access.
INTRODUCTION TO ACCESS. OBJECTIVES  Define the terms field, record, table, relational database, primary key, and foreign key  Create a blank database.
Databases and ADO.NET Programming Right from the Start with Visual Basic.NET 1/e 11.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 25 I’m Suffering from Information Overload.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
Chapter 24 I’m Suffering from Information Overload (Access Databases) Clearly Visual Basic: Programming with Visual Basic nd Edition.
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.
COMPREHENSIVE Access Tutorial 1 Creating a Database.
Chapter 9 Working with Databases. Copyright © 2011 Pearson Addison-Wesley Introduction In this chapter you will learn: – Basic database concepts – How.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
Visual Basic Database Access
Tutorial 1 Creating a Database
Y.-H. Chen International College Ming-Chuan University Fall, 2004
Microsoft Visual Basic 2010: Reloaded Fourth Edition
Prepared By: Bobby Wan Microsoft Access Prepared By: Bobby Wan
Visual Basic 2010 How to Program
GO! with Microsoft Office 2016
Access Tutorial 1 Creating a Database
Practical Office 2007 Chapter 10
Introduction to Microsoft Access
Incorporating Databases with ADO.NET
GO! with Microsoft Access 2016
Access Creating a Database
Created by Kamila zhakupova
Access Creating a Database
Incorporating Databases with ADO.NET
Access Tutorial 1 Creating a Database
MODULE 7 Microsoft Access 2010
VISUAL BASIC INTRODUCTION TO DATA CONNECTIVITY.
CIS16 Application Programming with Visual Basic
Access Tutorial 1 Creating a Database
Access Tutorial 1 Creating a Database
Grauer and Barber Series Microsoft Access Chapter Two
Database Connections.
Unit J: Creating a Database
Presentation transcript:

Working With Databases In Visual Basic

Data Sources Data Sources for your VB Applications may include files in the following and other formats: MS Access MS Excel MS FoxPro dBase Lotus Comma Delineated Text

What is a database? “An organized collection of data” Built in methods exist to help us access data from databases.

Tables Databases may include several separate sets of data called tables. Each table typically represents a different type of data. One table may cover customers, another may handle products, for instance.

Database Tables Our Store Inc. Customers Orders Products

Records and Fields Each table is divided into ROWS, often referred to as RECORDS, and COLUMNS, also known as FIELDS. A record contains the information about one particular thing. A field is one particular type of data.

Records and Fields This all makes more sense in visual format. The rows, or records, show related data. The columns, or fields, represent the individual pieces of information each record has.

Recordsets Recordsets are the information your program pulled out of the database to work with.

SQL SQL, or Sequel, is a language used for interacting with databases.

Creating a recordset with SQL Sample SQL: Select * From Employees; or Select ID, LastName, FirstName, SSN From Employees Where LastName = ‘Smith’;

SQL There are about 300 Keywords in SQL, but only about a dozen that are essential for most queries and updates. The Data control and the optional Microsoft ADO controls handle a lot of this for you.

Two Controls The Data Control is in the standard toolbox and handles basic database interaction The Microsoft ADO control is an added control. Much can be done via the automatic functionality, but you may wish to code your interaction for more control.

Database Options The visual data manager can be used to make simple databases. I recommend using MS Access. There are two MS Access databases in the full implementation of VB: NWIND.MDB and BIBLIO.MDB.

Database Interaction with the VB Application Wizard The book does not list the first steps. You will remember the application wizard from the first chapter. See Pages 583 ff.

Common Database Actions .MoveFirst .MoveLast .MoveNext .MovePrevious dtaCust.Recordset.Movefirst

EOF and BOF To make sure you stay within the records of the database without error, you may add some code to see if you are at the beginning of (BOF) or end of (EOF) of the table. If not adoBooks.Recordset.EOF then

Connecting datMyData.RecordSource = “select Address,City,CompanyName,ContactName,ContactTitle,Country,CustomerID,Fax,Phone,PostalCode,Region from Customers” ConnectionString property is set via the Custom ADO Control. It can also be copied and set manually if you wish.

Binding Each text box, label, or checkbox must be bound to a field. This is similar to our video picture box being bound to the multimedia control. DataField property associates this DataSource indicates the data control associated with the text box (or other control).

MSAccess Access is available on numerous campus computers. The specific databases we are using may be on several computers (rm. 1013).

Access Click on design view to change the data types. For instance, you may wish to save the data as numbers or as text. The first field is usually a Primary Key, or Index. Each record’s index or primary key has a unique value. That is necessary since even a value such as Name or Social Security Number may be repeated or inapplicable. Double click on the table to view the data in it.

Summary Databases and VB interaction are subjects warranting books and classes of their own. We just touch the surface here.