Subject VISUAL PROGRAMMING
Semester V
Title
Subject
21UCA12 Specialization NA
Code
Type Core: Theory L:T:P:C 75:5:0:4
Unit Contents Levels Sessions
Welcome to Visual Basic – Creating an Application – IDE
I K1 15
Forms and Controls – Variables in Visual Basic.
II Writing Code in Visual Basic – Working with File – Me K2 15
Multiple Document Interface Applications – Debugging Tips –
III K3 15
The Common Dialog Control.
Introduction to Database – Working with the Data Control –
IV K4 15
Data Access Objects.
V ActiveX Data Objects – Crystal and Data Report – Active X. K5 15
Learning Resources
Text Programming with Visual Basic 6.0, Mohammed Azam, Vikas Publishing House Pvt.
Books Ltd., Chennai.
Reference 1. Gary Cornell, "Visual Basic 6 from the Ground up", McGraw-Hill
Books Education,1998
2. Julia Case Bradley and Anita C.Millspaugh, "Programming in Visual Basic 6.0",
Tata McGraw-Hill Edition, 2011.
Website/ NPTEL & MOOC courses titled VB
Link https://www.freetutes.com/learn-vb6/
Mapping with Programme Outcomes
CO Number
PS01 PS02 PS03 PS04
CO1 S M M --
CO2 M S L -
CO3 S M L M
CO4 S M M L
CO5 S M L L
S- Strong , M- Medium , L – Low
59
, UNIT-I
Welcome to VB:
Before we begin Visual Basic 6 programming, let us understand some basic concepts of
programming. A computer program is an organized list of instructions that, when executed, causes
the computer to behave in a predetermined manner. Without programs, computers are useless.
Therefore, programming means designing or creating a set of instructions to ask the computer to
carry out certain jobs, which normally are very much faster than human beings can do.
What is Visual Basic?
Visual Basicis a computer programming system developed and owned by Microsoft. Visual
Basic was originally created to make it easier to write programs for the Windows computer
operating system. The basis of Visual Basic is an earlier programming language called BASIC that
was invented by DartmouthCollege professors John Kemeny and Thomas Kurtz. Visual Basic is
often referred to using just the initials -VB. Visual Basic is easily the most widely used computer
programming system in the history of software.
Visual Basic was one of the first products to provide a graphical programming
environment and a paint metaphor for developing user interfaces. Instead of worrying about syntax
details, the Visual Basic programmer can add a substantial amount of code simply by dragging and
dropping controls, such as buttons and dialog boxes, and then defining their appearance and
behavior.
Although nota true object-oriented programming language in the strictest sense, Visual
Basic nevertheless has an object-oriented philosophy. It is sometimes called an Event-Driven
Language because each object can react to different events such as a mouse click.
Since its launch in 1990, the Visual Basic approach has become the norm for programming
languages. Now there are visual environments for many programming languages, including C, C++,
Pascal, and Java. Visual Basic is sometimes called a Rapid Application Development (RAD)
system because it enables programmers to quickly build prototype applications.
Visual Basic 1.0 (May 1991) was released for Windows at the Comdex/Windows World
trade show in Atlanta, Georgia.
Visual Basic 1.0 for DOS was released in September 1992.
Visual Basic 2.0 was released in November 1992.
Visual Basic 3.0 was released in the summer of 1993 and came in Standard and
Professional versions.
Visual Basic4.0 (August 1995) was the first version that could create 32-bit as well as 16-
bit Windows programs.
Visual Basic5.0 (February 1997), Microsoft released Visual Basic exclusively for 32-bit
versions of Windows. It was also used as an introductory form of Visual Basic: a regular
.exe project could be created and run in the IDE, but not compiled.
Visual Basic6.0 (Mid 1998) improved in a number of areas including the ability to create
web-based applications. Although the Visual Basic 6.0 development environment is no
longer supported, the runtime is supported on Windows Vista, Windows Server 2008 and
Windows
,Features of Visual Basic
Visual Basic is not only a programming language, but also a complete Graphical
Development Environment.
This environment allows users with little programming experience to quickly develop
useful Microsoft Windows applications which have the ability to use OLE (Object Linking
and Embedding) objects, such as an Excel spreadsheet.
Visual Basic also has the ability to develop programs that can be used as a front end
application to a database system, serving as the user interface which collects user input and
displays formatted output in a more appealing and useful form than many SQL versions are
capable of.
Visual Basic's main selling point is the ease with which it allows the user to create nice
looking,graphical programs with little coding by the programmer, unlike many
otherlanguages that may take hundreds of lines of programmer keyed code.
As the programmer works in the graphical environment, much of the program code is
automatically generated by the Visual Basic program. In order to understand how this
happens, it is necessary to understand the major concepts, objects and tools used by Visual
Basic.
Visual Basic Editions
Visual Basic is available in three versions, each geared to meet a specific set of
development requirements. They are
Learning edition
Professional edition
Enterprise edition
Learning edition
The Visual Basic Learning edition allows programmers to easily create powerful
applications for Microsoft Windows 95 and Windows NT.
It includes all intrinsic controls, plus grid, tab, and data-bound controls.
Documentation provided with this edition includes Learn VB Now (a multimedia
CD-ROM title), a printed Programmer's Guide, online Help, plus Visual Basic
Books Online.
It also incorporates a limited subset of theJet engine's data access capabilities in the
Data control and special data-bound controls. These featuresallow you to access
existing databases, but do not provide for creating new databases or data
accessobjects.
Professional Edition
The Professional Edition provides computer professionals with a full featured set
of tools for developing solutions for others.
It includes all the features of the Learning edition, plus additional ActiveX
controls, including Internet controls, and the Crystal Report Writer.
Documentation provided with the Professional edition includes the Programmer's
Guide, online Help, the Component Tools Guide and the Crystal Reports for
Visual Basic User's Manual.
, The Professional Edition includes all of the Data control features, and in addition
provides the full data access objects programming interface. Professional Edition
users can combine data access objects with the Data control to gain all of the
advantages of simplified data access while maintaining the flexibility of complete
programmatic control.
Enterprise edition
The Enterprise Edition allows professionals to create robust distributed
applications in a team setting.
Itincludes all the features of the Professional edition, plus the Automation
Manager, Component Manager, database management tools, the Microsoft
Visual SourceSafe project-oriented version control system, andmore.
Printed documentation provided with the Enterprise edition includes all Professional
edition pieces,plus the Building Client/Server Applications with Visual Basic
book and the SourceSafe User's Guide.
TheEnterprise Edition adds a number of powerful Client/Server tools to Visual
Basic's data access capabilities,including the Remote Data control (RDC)
specifically designed to access remote ODBC client/serverdatabases
The Visual Basic Philosophy
VB Control is an object that can be drawn on a Form object to enable or enhance user
interaction with an application.
Controls have Properties that define aspects their appearance, such as position, size and
color, and aspects of their behavior, such as their response to the user input.
Controls can respond to Events initiated by the user or set off by the system. For instance, a
code could be written in a CommandButton control's click event procedure that would load
a file or display a result.
In addition to properties and events, methods can also be used to manipulate controls from
code. For instance, the move method can be used with some controls to change their
location and size.
Most of the controls provide choices to users that can be in the form of OptionButton or
CheckBoxcontrols, ListBoxentries or ScrollBars to select a value.
Developing an Application
Steps in Building a Visual Basic Application
Step 1: Design the interface
Step 2: Set properties of the controls (Objects)
Step 3: Write the event procedures or code
First thing to do is to create a Directory where you will store all your VB Projects. Call it
VBApps, for example. Then start VB. The first screen will ask whether you want to open a new
project or an existing one - it's obviously a new one and it will be a Standard EXE. Then,
maximize all the windows. Now, save your project. It will first ask you to save the form with the
extension .frm - and then the Project –with extension .vbp.