6 Using Visual Basic 6 0 to Create

6 Using Visual Basic 6. 0 to Create Web-Based Database Applications

6 Chapter Objectives • Create programmatic data controls to process data in a Visual Basic program • Create a Visual Basic Active. X document that is run from a Web page

6 Active. X Documents • Active. X documents – A program that users can download from a Web site and install on their computers Figure 6 -1: Installing an Active. X document

6 Overview of Visual Basic • Visual Basic – Can be used to create almost any kind of Windowsbased program – An event-driven programming language • Program statements execute in response to user actions or to system actions

Components of a Visual Basic Program 6 • Project file – Specifies properties of the program and the names of the individual component of the program • Form – Main components of a VB project – Composed of the visible interface that the user sees and interacts with, and the associated code that responds to user and system actions

6 Components of a Visual Basic Program • Standard module – Contains only code – Used to store declarations for variables that are used in multiple forms • Procedure – Manipulates variable values • Function – Returns a single value based on parameters that are passed to the function

6 Components of a Visual Basic Program • Controls are the visible items on a form Figure 6 -2: Form Controls

6 Visual Basic Projects • When VB is started, a new project is created, which corresponds to an individual user application • When you create a new project, you can select the type of project it will be, which specifies how the project file is compiled

6 Visual Basic Projects Figure 6 -3: Visual Basic project types

6 The Visual Basic Development Environment • Integrated development environment (IDE) – Environment for developing programs Figure 6 -4: VB IDE components

6 The Visual Basic Development Environment • Main IDE components include: – The toolbar provides quick access to menu bar commands for opening – The Object window shows the form and the position of the controls on the form – The toolbox contains icons that are used to create form controls

6 Creating a Visual Basic Database Application Figure 6 -8: Clearwater Traders Inventory Maintenance application

6 Modifying Form Properties Table 6 -1: VB object name prefixes

6 Saving Visual Basic Projects • A VB project is saved in a file with a. vbp extension • Forms are saved in files with an. frm extension • When you create a new project, it is very important to always save the project (. vbp) file and the form (. frm) file in the same folder in your file system

6 THANK YOU
- Slides: 15