CVEV 118/698 Database Programming Lecture 1 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.

Slides:



Advertisements
Similar presentations
Basics of Database Programming with VB6
Advertisements

MS Access.
Automating Tasks With Macros
XP Chapter 3 Succeeding in Business with Microsoft Office Access 2003: A Problem-Solving Approach 1 Analyzing Data For Effective Decision Making.
CVEV 118/698 Databases Lecture 1 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
CVEV 118/698 Visual Basic Lecture 1 Prof. Mounir Mabsout Expert 1: Elsa Sulukdjian Expert 2: Walid El Asmar.
CVEV 118/698 AutoCAD VBA Lecture 1 Prof. Mounir Mabsout
Using Objects and Properties
CVEV 118/698 Databases Lecture 2 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
CVEV 118/698 Active Server Pages Lecture 3 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
Automating Tasks With Macros. 2 Design a switchboard and dialog box for a graphical user interface Database developers interact directly with Access.
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.
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.
Component 8, Slide 1 CP2030 Visual basic for C++ Programmers, ‘The VB Team’ Copyright © University of Wolverhampton CP2030 Visual Basic For C++ Programmers.
1 Chapter 1 Tour of Access. 1 Chapter Objectives Start and exit Microsoft Access Open and run an Access application Identify the major elements of the.
Academic Year 2014 Spring.
CORE 2: Information systems and Databases STORAGE & RETRIEVAL 2 : SEARCHING, SELECTING & SORTING.
Microsoft Access Ervin Ha.
Access Tutorial 10 Automating Tasks with Macros
MS Access Advanced Instructor: Vicki Weidler Assistant:
Microsoft Access Intro Class 1 Database Concepts.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
Pasewark & Pasewark Microsoft Office 2003: Introductory 1 INTRODUCTORY MICROSOFT ACCESS Lesson 1 – Access Basics.
Database Lecture # 1 By Ubaid Ullah.
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
ASP.NET Programming with C# and SQL Server First Edition
Using Visual Basic 6.0 to Create Web-Based Database Applications
1 Overview of Databases. 2 Content Databases Example: Access Structure Query language (SQL)
Analyzing Data For Effective Decision Making Chapter 3.
Copyright © 2001 by Wiley. All rights reserved. Chapter 9: Introduction to Working with Databases in Visual Basic Database Concepts Relational Database.
Universal Data Access and OLE DB. Customer Requirements for Data Access Technologies High-Performance access to data Reliability Vendor Commitment Broad.
Faculty of Electronic Engineering 1 Database Access API’s Aleksandar Stanimirović Leonid Stoimenov Aleksandar Milosavljević.
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.
11 3 / 12 CHAPTER Databases MIS105 Lec15 Irfan Ahmed Ilyas.
You can use Access forms to create an interface to your reports and queries. You can add: Buttons to initiate reports and queries Combo Boxes, List.
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
Views Lesson 7.
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.
MS Access: Introduction 1Database Design. MS Access: Overview MS Access A Database Management System (DBMS) designed to create applications that organize,
1 MIS309 Database Systems Introduction to Microsoft Access.
Course FAQ’s I do not have any knowledge on SQL concepts or Database Testing. Will this course helps me to get through all the concepts? What kind of.
Database Concepts Track 3: Managing Information using Database.
XP New Perspectives on Microsoft Office Access 2003 Tutorial 10 1 Microsoft Office Access 2003 Tutorial 10 – Automating Tasks With Macros.
Chapter 11: Introduction to VBA Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
Database Connectivity with ASP.NET. 2 Introduction Web pages commonly used to: –Gather information stored on a Web server database Most server-side scripting.
Understanding Visual Basic Fundamentals CHAPTER 13 Understanding Visual Basic Fundamentals.
IS2803 Developing Multimedia Applications for Business (Part 2) Lecture 6: Accessing a database with PHP Rob Gleasure robgleasure.com.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
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.
PREPARED BY: PN. SITI HADIJAH BINTI NORSANI. LEARNING OUTCOMES: Upon completion of this course, students should be able to: 1. Understand the structure.
SQL Basics Review Reviewing what we’ve learned so far…….
Lecture 4 Manipulating Form Data using methods of Recordset and RecordsetClone in VBA Restrict data with filter 1 Rapid Application Development.
 2 Data Object Library approaches ◦ DAO (Data Access Objects)  Original access strategy (up to VB6)  Closely linked to MS Access ◦ ADO (ActiveX Data.
Visual Basic Database Access
Data Access Objects .
MS Access Introduction Database Design.
The Recordset Object.
Created by Kamila zhakupova
Database.
Database Objects 1/12/2019 See scm-intranet.
Working With Databases
DATABASES WHAT IS A DATABASE?
Course Instructor: Supriya Gupta Asstt. Prof
Unit – V Data Controls.
Presentation transcript:

CVEV 118/698 Database Programming Lecture 1 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar

Introduction MS Access is a very particular commercial application for it is provided with two programming tools: Macros & VBA. MS Access is a very particular commercial application for it is provided with two programming tools: Macros & VBA. Macros can be quickly and easily developed even with a primitive programming knowledge. Macros can be quickly and easily developed even with a primitive programming knowledge. However, their functionality is limited. For complex database projects, VBA should be used. However, their functionality is limited. For complex database projects, VBA should be used.

VBA/Macros Both Macros and VBA use the same set of predefined instructions for common actions, I.e. opening, closing, importing, etc. objects. Both Macros and VBA use the same set of predefined instructions for common actions, I.e. opening, closing, importing, etc. objects. “Actions” are to Macros what “Methods” are to VBA. “Actions” are to Macros what “Methods” are to VBA. The two automating tools are not totally independent, you can run macros from a VBA application and vice-versa. The two automating tools are not totally independent, you can run macros from a VBA application and vice-versa. Yet, each has a different way of acting on database object. Yet, each has a different way of acting on database object.

VBA/Macros (Cont’d) Macros act directly at the level of the object; except for the SetValue action that allows modifying the value of some object properties. Macros act directly at the level of the object; except for the SetValue action that allows modifying the value of some object properties. The DoCmd can be used in VBA to call a Macro, and vice versa. The DoCmd can be used in VBA to call a Macro, and vice versa. Macros Actions ‘SetValue’ Object Properties VBA Methods Object enabled approach ‘ DoCmd’ Command Limited approach

VBA/Macros (Cont’d) There are approximately 50 macro actions in Access. There are approximately 50 macro actions in Access. The actions that can be performed are predefined, and limited in number. The actions that can be performed are predefined, and limited in number. Examples: Examples: – Open Report – Open Form

Data Access Components When installing Access, you actually install two major components: the Access Application Layer and the Jet Database Engine. When installing Access, you actually install two major components: the Access Application Layer and the Jet Database Engine. The Access Application is the part you interact with to display the database objects. The Access Application is the part you interact with to display the database objects. The Jet Database Engine is the part where you manage the data in the database. The Jet Database Engine is the part where you manage the data in the database.

Data Access Components (Cont’d) The Access Application Layer & the Jet Database Engine communicate with each other using Data Access Languages. The Access Application Layer & the Jet Database Engine communicate with each other using Data Access Languages. Data Access Languages Data Access Languages In Access, there are two Data Access Languages: Structured Query Language (SQL) and ActiveX Data Objects (ADO). In Access, there are two Data Access Languages: Structured Query Language (SQL) and ActiveX Data Objects (ADO). Data Access Languages work as links that access, retrieve, manipulate, etc. data. Data Access Languages work as links that access, retrieve, manipulate, etc. data.

The Object Model Remember that VBA is Object oriented programming. Remember that VBA is Object oriented programming. Objects have Properties and Methods to modify those properties. Objects have Properties and Methods to modify those properties. The object model is a hierarchical organization of objects, groups of similar objects and relations. The object model is a hierarchical organization of objects, groups of similar objects and relations. Access is organized into 2 separate hierarchies, one stemming from the Access Application Layer and the other from the Jet Database Engine. Access is organized into 2 separate hierarchies, one stemming from the Access Application Layer and the other from the Jet Database Engine. Thus, Data Access Languages will function as links between those 2 trees. Thus, Data Access Languages will function as links between those 2 trees.

Access Application Hierarchy Controls ReferencesModulesReportsForms Module Application ScreenDoCmd Controls Module

Jet Data Base Engine Hierarchy Users ErrorsWorkspaces DBEngine GroupsDatabases TableDefs QueryDefsRecordsets RelationsContainers DocumentsFields Indexes

Referring to Objects by Name One way to refer to an object is to trace its position in the object model, traversing the hierarchy from the top downward. One way to refer to an object is to trace its position in the object model, traversing the hierarchy from the top downward. The exclamation point operator (!), or ‘bang’, is used to step from a collection to one of its members. The exclamation point operator (!), or ‘bang’, is used to step from a collection to one of its members. The dot operator (.) to step from an object to one of its collections. The dot operator (.) to step from an object to one of its collections.

Example Accession a form in the Access Application model: Accession a form in the Access Application model:Application.Forms!NameOfForm Don’t forget to enclose in square brackets if the name contains spaces: Don’t forget to enclose in square brackets if the name contains spaces: Application.Forms![Name Of Form] Note that you can decrease the length of a reference by using defaults: I.e. Access assumes that you are in Access when you refeer to objects: Note that you can decrease the length of a reference by using defaults: I.e. Access assumes that you are in Access when you refeer to objects:Forms!NameOfFormReports!NameOfReport A dot is appended at the end of this reference protocol to access an object property. A dot is appended at the end of this reference protocol to access an object property.

Recordset Object A Recordset object represents the entire set of records from a base table or the results of an executed command. A Recordset object represents the entire set of records from a base table or the results of an executed command. At any time, the Recordset object refers to only a single record within the set as the current record. At any time, the Recordset object refers to only a single record within the set as the current record. The Recordset Object represents the entire set of records from a Table or Query The Recordset Object represents the entire set of records from a Table or Query

Recordset Object (Cont’d) Examples: Examples: Dim rst As New ADODB.Recordset set rst.ActiveConnection = conn rst.Open "Engineer" - OR - rst.Open "SELECT ENFName, ENLName, ENDOB FROM Engineer" With a recordset you can access the whole set of rows in the table or query. With a recordset you can access the whole set of rows in the table or query. However, at a given moment the recordset will have a single row as the current row, and data can be read from and written only to this row. However, at a given moment the recordset will have a single row as the current row, and data can be read from and written only to this row.

Recordset Object (Cont’d) Navigation between rows is performed through a set of functions: Navigation between rows is performed through a set of functions: – MoveFirst – MoveLast – MoveNext – MovePrevious Data is read and written through the Fields collection. It acts on the current record. Data is read and written through the Fields collection. It acts on the current record. Example: Example: rst.Fields("ENFName") = "Karim“ rst.MoveNext Debug.Print rst.Fields("ENDOB")

What’s Next Less concepts, more methods! Less concepts, more methods!