5. Using databases in VB.

Slides:



Advertisements
Similar presentations
Sep-05 Slide:1 VBA in Excel Walter Milner. Sep-05 Slide:2 VBA in Excel Introduction VBA = Visual Basic for Applications Enables end-user programming In.
Advertisements

Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
Modeling using VBA. Covered materials -Userforms -Controls -Module -Procedures & Functions -Variables -Scope.
Different type of input Use of Basic language with Excel Silvia Patacchini.
VBA for MS Excel Hamze Msheik. Open the Visual Basic Editor in Excel 2007 Click on the Microsoft Office button in the top left of the Excel window and.
The ADO Data Control. Universal Data Access Open Database Connectivity (ODBC) –standard for accessing data in databases OLE-DB –allows access to data.
Using Visual Basic 6.0 to Create Web-Based Database Applications
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 6 1 Microsoft Office Excel 2003 Tutorial 6 – Working With Multiple Worksheets.
Using Objects and Properties
The Repetition Structure Lecture 11 08/07/06 Dan Rao.
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:
Using the Data Access Controls: DAO & ADO Presented by Victor Matos.
1 Chapter 20 — Creating Web Projects Microsoft Visual Basic.NET, Introduction to Programming.
WORKING WITH FILES, MENUS AND DATABASES IN VISUAL BASIC BY V. V. SUBRAHMANYAM.
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
Visual Basic 2008 Express Edition The IDE. Visual Basic 2008 Express The Start Page Recent Projects Open an existing project Create a New Project.
 Excel – Basic Elements  Using Macros  Excel VBA Basics  Excel VBA Advanced.
Integrate. Automate. eXLerateTM
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Using the Select Case Statement and the MsgBox Function (Unit 8)
Copyright © 2001 by Wiley. All rights reserved. Chapter 10: Advanced Database Operations Revising Vintage Videos Setting RecordSource at run time DBGrid.
Automating Tasks with Visual Basic. Introduction  When can’t find a readymade macro action that does the job you want, you can use Visual Basic code.
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.
Using Visual Basic 6.0 to Create Web-Based Database Applications
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.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 11 Accessing Database.
Working with Numeric Variables (Unit 6) Visual Basic for Applications.
Numeric Variables Visual Basic for Applications 6.
Database Management School of Business Eastern Illinois University © Abdou Illia, Fall 2002 (Week 16, Monday 12/09/2002)
VBA Lab 2 I ns.Samia Al-blwi. Visual Basic Grammar Object: Visual Basic is an object-oriented language. This means that all the items in Excel are thought.
Faculty of Electronic Engineering 1 Database Access API’s Aleksandar Stanimirović Leonid Stoimenov Aleksandar Milosavljević.
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
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.
24/01/2011 harshana-fernando.blogspot.com 1 Introduction to Procedures Modules A module is a file that holds code or pieces of code in a Visual Basic application.
1 MIS309 Database Systems Introduction to Microsoft Access.
AVCE ICT – Unit 7 - Programming Session 16 – Database and VB.
INSERT BOOK COVER 1Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall. Exploring Getting Started with VBA for Microsoft Office 2010 by.
1 Chapter 10 – Database Management 10.1 An Introduction to Databases 10.2 Editing and Designing Databases.
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.
Data Control In this presentation… –databases supported –inserting a data control –data control properties –using the data control.
Lecture 4 Manipulating Form Data using methods of Recordset and RecordsetClone in VBA Restrict data with filter 1 Rapid Application Development.
How to: Simple User Interface WMCUG 13 th Jan 2010 Gord Vander Vliet Enterprise Tool & Die, LLC Jeff Roark Johnson Controls.
 2 Data Object Library approaches ◦ DAO (Data Access Objects)  Original access strategy (up to VB6)  Closely linked to MS Access ◦ ADO (ActiveX Data.
Lesson 1: Learning Worksheet Fundamentals Microsoft Office Excel 2003 Lesson 1 Learning Worksheet Fundamentals.
Visual Basic Database Access
Dave Pendreigh Audit Specialist, HMRC
Creating Data Base & Sql Data Source
VB 2010 Pertemuan 10.
Database vs. DBMS Database Database Management System
Created by Kamila zhakupova
Introduction to VB6 Week 1 3/2/2004 PPCC - Introduction to VB6
ADO.NET Accessing Databases in VS.NET
Microsoft Office Illustrated
VB.NET Using Database.
ربط الفيجوال بيسك VB مع قواعد البيانات
Department Array in Visual Basic
VISUAL BASIC INTRODUCTION TO DATA CONNECTIVITY.
CS285 Introduction - Visual Basic
Creating Data Base & Sql Data Source
Chapter 7 Searching Your Products
Chapter 10 Accessing Database Files
Intro to Excel CSCI-150.
Microsoft Office Excel 2003
Custom Forms with VBA in Excel In-Class Exercise #11
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

5. Using databases in VB

5.1 Introduction to Jet Engine Jet Engine is Database management system. The Microsoft Jet engine treats the Ms access database as a single file with many tables inside that file. To Microsoft Jet , the directory folder is the database and ISAM files are the data tables.

The Microsoft Jet engine is a set of routines that works together. These routines convert your Ms Jet request into a request that the target database can understand. The ODBC interface is capable of accessing data in client server databases, ISAM databases (FoxPro, MS access , Excel) and text files.

As with accessing other type of ISAM files with the jet engine there are few restrictions. When opening an ISAM database with open database method you must provide a valid ISAM time

ODBC and ISAM ODBC means Open Database Connectivity. There are different methods of database connectivity such as using DATA1 control, ADO Data Control, ADO (through object), DAO. ISAM stands for Indexed Sequential Access Methods.

The Microsoft Jet engine treats the Ms access database as a single file with many tables inside that file. To Microsoft Jet , the directory folders is the database and ISAM files are the data tables. The Microsoft Jet engine is a set of routines that works together. These routines convert your Ms Jet request into a request that the target database can understand.

The ODBC interface is capable of accessing data in client server databases, ISAM databases (FoxPro, MS access , Excel) and text files. As with accessing other type of ISAM files with the jet engine there are few restrictions When opening an ISAM database with open database method you must provide a valid ISAM time.

5.3 using Databases Using the databases of – i) Access ii) FoxPro iii) Excel iv) Oracle

Using Databases of Access First create any one database in Microsoft access or use already created database that you want to be connect with your VB application Select DATA1 control from toolbox and drag it on your form Take another controls that you required. Set data1’s database property .give full name of access database that you want to be create

Then set it’s Recordsource property Then set datasource property of textbox is data1. Then set datafield property of textbox. It will display database information as you require in textbox

Using Databases of FoxPro First create any one FoxPro database or use already created database that you want to connect in your application. Take textboxes and other controls that you want in your application. Use Active Data Object (ADO) in your application. You must add reference to the ADO Object Library in the References dialog box.

To establish an explicit connection to a data source, declare a connection variable with the statement Dim ADOconn As New ADODB.connection Call the ADOConn object’s open method by passing the connection string as an argument: ADOConn.open” ” Once the connection object is created you can assign it to the activeconnection property of the recordsource

Using Databases of Excel Workbook: the class represents an Excel file Worksheet: represents a single worksheet Sheet: represents a single worksheet or chartsheet Cell: represents a single cell

VBA entities Example :

Excel Containers Workbooks: a collection of objects of class “Workbook” Worksheets: a collection of objects of class “Worksheet” Sheets: a collection of Sheet objects Range: a range of objects of class Cell

Referencing the Objects - Examples This will take the whole square between the two cells Sub Test1() Worksheets("Sheet1").Range("A10", "B12") = "Hello“ Worksheets(1).Range("A13,B14") = "World!" End Sub Two equal ways to refer Sheet1 The range of two cells

The Output Which Workbook was Used?

How many times the user will click on the button? The Output! How many times the user will click on the button?

Using Databases Of Oracle First create any one database in Oracle or use already created database that you want to be connect to your application. Use any method of database connectivity such as ADO Data Control or ADO i.e.:- through coding using object or DAO.