Post on 03-Apr-2018
7/28/2019 Sourabh Singh
1/76
PRACTICAL FILE
VISUAL BASIC
(SESSION 2011-2014)
SUBMITTED TO: SUBMITTED BY:
Ms. SHRUTI TANIA MALHOTRA
ENROLLMENT NO. 03612401911
BBA (CAM) 4TH SEM
DELHI INSTITUTE OF RURAL DEVELOPMENT, DELHI
(AFFILATED TO GURU GOBIND SINGH INDRAPRASTHA UNIVERSITY)
7/28/2019 Sourabh Singh
2/76
INDEX
Introduction to
visual basic
History
Program 1 Arithmetic operation
Program 2 Calculate simple interest
Program 3 Calculate D.A,H.R.A,P.F, & net salary
Program 4 Number is odd or even
Program 5 Swapping of two no. using third variable and without using third
variable
Program 6 Commonly used string function
Program 7 Given number is prime or not
Program 8 Check whether a string is palindrome or not
Program 9 Calculate total marks, percentage, and grade of 5 subject
Program 10 Input a no. from 1 to 7 and returns the Corresponding day of week
with the help of select case statement
Program 11 Calculate sum and average of 10 numbers using an array
Program 12 Display maximum and minimum
Program 13 Matrix addition using a two dimensional array
Program 14 Generate FIBONICCI series
Program 15 Calculate the table of a given no. also the factorial of a given no.
Program 16 Connect MS- access to visual basic
7/28/2019 Sourabh Singh
3/76
INTRODUCTION TO VISUAL BASICS
Visual Basic
Visual Basic is athird-generationevent-driven programming
languageandintegrated development environment(IDE)
fromMicrosoftfor itsCOMprogramming model first released in 1991.
Visual Basic is designed to be relatively easy to learn and use. VisualBasic was derived fromBASICand enables therapid application
development (RAD)ofgraphical user interface (GUI)applications,
access todatabasesusingData Access Objects,Remote Data Objects,
orActiveX Data Objects, and creation ofActiveXcontrols and objects.
Thescripting languageVBScriptis a subset of Visual Basic.
A programmer can create an application using
thecomponentsprovided by the Visual Basic program itself. Programs
written in Visual Basic can also use theWindows API, but doing so
requires external function declarations. Though the program has
received criticism for its perceived faults, version 3 of Visual Basic was a
http://en.wikipedia.org/wiki/Third-generation_programming_languagehttp://en.wikipedia.org/wiki/Third-generation_programming_languagehttp://en.wikipedia.org/wiki/Event-driven_programminghttp://en.wikipedia.org/wiki/Event-driven_programminghttp://en.wikipedia.org/wiki/Event-driven_programminghttp://en.wikipedia.org/wiki/Event-driven_programminghttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Microsofthttp://en.wikipedia.org/wiki/Microsofthttp://en.wikipedia.org/wiki/Microsofthttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/Rapid_application_developmenthttp://en.wikipedia.org/wiki/Rapid_application_developmenthttp://en.wikipedia.org/wiki/Rapid_application_developmenthttp://en.wikipedia.org/wiki/Rapid_application_developmenthttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Databasehttp://en.wikipedia.org/wiki/Databasehttp://en.wikipedia.org/wiki/Databasehttp://en.wikipedia.org/wiki/Data_Access_Objecthttp://en.wikipedia.org/wiki/Data_Access_Objecthttp://en.wikipedia.org/wiki/Data_Access_Objecthttp://en.wikipedia.org/wiki/Remote_Data_Objectshttp://en.wikipedia.org/wiki/Remote_Data_Objectshttp://en.wikipedia.org/wiki/Remote_Data_Objectshttp://en.wikipedia.org/wiki/ActiveX_Data_Objecthttp://en.wikipedia.org/wiki/ActiveX_Data_Objecthttp://en.wikipedia.org/wiki/ActiveX_Data_Objecthttp://en.wikipedia.org/wiki/ActiveXhttp://en.wikipedia.org/wiki/ActiveXhttp://en.wikipedia.org/wiki/ActiveXhttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/VBScripthttp://en.wikipedia.org/wiki/VBScripthttp://en.wikipedia.org/wiki/VBScripthttp://en.wikipedia.org/wiki/Component-based_software_engineeringhttp://en.wikipedia.org/wiki/Component-based_software_engineeringhttp://en.wikipedia.org/wiki/Component-based_software_engineeringhttp://en.wikipedia.org/wiki/Windows_APIhttp://en.wikipedia.org/wiki/Windows_APIhttp://en.wikipedia.org/wiki/Windows_APIhttp://en.wikipedia.org/wiki/Windows_APIhttp://en.wikipedia.org/wiki/Component-based_software_engineeringhttp://en.wikipedia.org/wiki/VBScripthttp://en.wikipedia.org/wiki/Scripting_languagehttp://en.wikipedia.org/wiki/ActiveXhttp://en.wikipedia.org/wiki/ActiveX_Data_Objecthttp://en.wikipedia.org/wiki/Remote_Data_Objectshttp://en.wikipedia.org/wiki/Data_Access_Objecthttp://en.wikipedia.org/wiki/Databasehttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Rapid_application_developmenthttp://en.wikipedia.org/wiki/Rapid_application_developmenthttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Microsofthttp://en.wikipedia.org/wiki/Integrated_development_environmenthttp://en.wikipedia.org/wiki/Event-driven_programminghttp://en.wikipedia.org/wiki/Event-driven_programminghttp://en.wikipedia.org/wiki/Third-generation_programming_language7/28/2019 Sourabh Singh
4/76
runaway commercial success, and many companies offered third party
controls greatly extending its functionality.
The final release was version 6 in 1998. Microsoft's extended support
ended in March 2008 and the designated successor wasVisual Basic.
NET (now known simply as Visual Basic).
A dialect of Visual Basic,Visual Basic for Applications(VBA), is used as a
macro or scripting language within several Microsoft applications,
including Microsoft Office.
Language features
Like theBASICprogramming language, Visual Basic was designed to be
easily learned and used by beginner programmers. The language not
only allows programmers to create simpleGUIapplications, but to also
develop complex applications. Programming in VB is a combination of
visually arrangingcomponentsorcontrolson aform, specifying
attributes and actions of those components, and writing additional
lines ofcodefor more functionality. Since default attributes and actions
are defined for the components, a simple program can be created
without the programmer having to write many lines of code.
Performance problems were experienced by earlier versions, but with
faster computers and native code compilation this has become less of
an issue.
http://en.wikipedia.org/wiki/Visual_Basic_.NEThttp://en.wikipedia.org/wiki/Visual_Basic_.NEThttp://en.wikipedia.org/wiki/Visual_Basic_.NEThttp://en.wikipedia.org/wiki/Visual_Basic_.NEThttp://en.wikipedia.org/wiki/Visual_Basic_for_Applicationshttp://en.wikipedia.org/wiki/Visual_Basic_for_Applicationshttp://en.wikipedia.org/wiki/Visual_Basic_for_Applicationshttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/GUI_widgethttp://en.wikipedia.org/wiki/GUI_widgethttp://en.wikipedia.org/wiki/GUI_widgethttp://en.wikipedia.org/wiki/GUI_widgethttp://en.wikipedia.org/wiki/GUI_widgethttp://en.wikipedia.org/wiki/GUI_widgethttp://en.wikipedia.org/wiki/Form_(programming)http://en.wikipedia.org/wiki/Form_(programming)http://en.wikipedia.org/wiki/Form_(programming)http://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Source_codehttp://en.wikipedia.org/wiki/Form_(programming)http://en.wikipedia.org/wiki/GUI_widgethttp://en.wikipedia.org/wiki/GUI_widgethttp://en.wikipedia.org/wiki/Graphical_user_interfacehttp://en.wikipedia.org/wiki/BASIChttp://en.wikipedia.org/wiki/Visual_Basic_for_Applicationshttp://en.wikipedia.org/wiki/Visual_Basic_.NEThttp://en.wikipedia.org/wiki/Visual_Basic_.NET7/28/2019 Sourabh Singh
5/76
Although VB programs can be compiled into native code
executablesfrom version 5 onwards, they still require the presence of
runtime libraries of approximately 1 MB in size. Runtime libraries are
included by default inWindows 2000and later, however for earlierversions ofWindows, i.e. 95/98/NT, runtime libraries must be
distributed together with the executable.
Forms are created usingdrag-and-droptechniques. A tool is used to
place controls (e.g., text boxes, buttons, etc.) on the form (window).
Controls haveattributesandevent handlersassociated with them.
Default values are provided when the control is created, but may be
changed by the programmer. Many attribute values can be modified
during run time based on user actions or changes in the environment,
providing a dynamic application. For example, code can be inserted into
the form resize event handler to reposition a control so that it remains
centered on the form, expands to fill up the form, etc. By inserting code
into the event handler for a key press in a text box, the program can
automatically translate the case of the text being entered, or evenprevent certain characters from being inserted. Visual Basic can create
executables (EXE files),ActiveX controls, or DLL files, but is primarily
used to develop Windows applications and to interface database
systems. Dialog boxes with less functionality can be used to provide
pop-up capabilities. Controls provide the basic functionality of the
application, while programmers can insert additional logic within the
appropriate event handlers. For example, a drop-down combinationbox will automatically display its list and allow the user to select any
element. An event handler is called when an item is selected, which can
then execute additional code created by the programmer to perform
http://en.wikipedia.org/wiki/Visual_Basic#Timeline_of_Visual_Basic_.28VB1_to_VB6.29http://en.wikipedia.org/wiki/Visual_Basic#Timeline_of_Visual_Basic_.28VB1_to_VB6.29http://en.wikipedia.org/wiki/Visual_Basic#Timeline_of_Visual_Basic_.28VB1_to_VB6.29http://en.wikipedia.org/wiki/Windows_2000http://en.wikipedia.org/wiki/Windows_2000http://en.wikipedia.org/wiki/Windows_2000http://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Drag-and-drophttp://en.wikipedia.org/wiki/Drag-and-drophttp://en.wikipedia.org/wiki/Drag-and-drophttp://en.wikipedia.org/wiki/Attribute_(computing)http://en.wikipedia.org/wiki/Attribute_(computing)http://en.wikipedia.org/wiki/Attribute_(computing)http://en.wikipedia.org/wiki/Event_handlerhttp://en.wikipedia.org/wiki/Event_handlerhttp://en.wikipedia.org/wiki/Event_handlerhttp://en.wikipedia.org/wiki/ActiveXhttp://en.wikipedia.org/wiki/ActiveXhttp://en.wikipedia.org/wiki/ActiveXhttp://en.wikipedia.org/wiki/ActiveXhttp://en.wikipedia.org/wiki/Event_handlerhttp://en.wikipedia.org/wiki/Attribute_(computing)http://en.wikipedia.org/wiki/Drag-and-drophttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Windows_2000http://en.wikipedia.org/wiki/Visual_Basic#Timeline_of_Visual_Basic_.28VB1_to_VB6.297/28/2019 Sourabh Singh
6/76
some action based on which element was selected, such as populating
a related list.
Alternatively, a Visual Basic component can have no user interface, and
instead provide ActiveX objects to other programs viaComponent
Object Model(COM). This allows forserver-sideprocessing or an add-in
module.
The runtime recovers unused memory usingreference countingwhich
depends on variables passing out of scope or being set to "Nothing",
resulting in the very common problem of memory leaks. There is a large
library of utility objects, and the language provides basicobjectoriented support. Unlike many other programming languages, Visual
Basic is generally not case sensitive, although it will
transformkeywordsinto a standard case configuration and force the
case of variable names to conform to the case of the entry within the
symbol table. String comparisons are case sensitive by default.
The Visual Basic compiler is shared with other Visual Studio languages
(C, C++), but restrictions in the IDE do not allow the creation of some
targets (Windows model DLLs) and threading models.
Characteristics
Visual Basic has the following traits which differ from C-derived
languages:
Statements tend to be terminated with keywords such as "End If",
instead of using "{}"s to group statements.
http://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Server-sidehttp://en.wikipedia.org/wiki/Server-sidehttp://en.wikipedia.org/wiki/Server-sidehttp://en.wikipedia.org/wiki/Reference_countinghttp://en.wikipedia.org/wiki/Reference_countinghttp://en.wikipedia.org/wiki/Reference_countinghttp://en.wikipedia.org/wiki/Object-oriented_programminghttp://en.wikipedia.org/wiki/Object-oriented_programminghttp://en.wikipedia.org/wiki/Object-oriented_programminghttp://en.wikipedia.org/wiki/Object-oriented_programminghttp://en.wikipedia.org/wiki/Keywordshttp://en.wikipedia.org/wiki/Keywordshttp://en.wikipedia.org/wiki/Keywordshttp://en.wikipedia.org/wiki/Keywordshttp://en.wikipedia.org/wiki/Object-oriented_programminghttp://en.wikipedia.org/wiki/Object-oriented_programminghttp://en.wikipedia.org/wiki/Reference_countinghttp://en.wikipedia.org/wiki/Server-sidehttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Component_Object_Model7/28/2019 Sourabh Singh
7/76
Multiple variable assignments are not possible. A = B = C does not imply
that the values of A, B and C are equal. The Boolean result of " Is B =
C?" is stored in A. The result stored in A would therefore be either false
or true.
Booleanconstant True has numeric value 1. This is because the
Boolean data type is stored as a 16-bit signed integer. In this construct
1 evaluates to 16 binary 1s (the Boolean value True), and 0 as 16 0s
(the Boolean value False). This is apparent when performing
a Not operation on a 16 bit signed integer value 0 which will return the
integer value 1, in other words True = Not False. This inherent
functionality becomes especially useful when performing logical
operations on the individual bits of an integer such as And, Or, X
or and Not. This definition of True is also consistent with BASIC since
the early 1970s Microsoft BASIC implementation and is also related to
the characteristics of CPU instructions at the time.
Logical and bitwise operators are unified. This is unlike some C-derived
languages (such asPerl), which have separate logical and bitwise
operators. This again is a traditional feature of BASIC.
Variablearraybase. Arrays are declared by specifying the upper and
lower bounds in a way similar toPascalandFortran. It is also possible
to use the Option Base statement to set the default lower bound. Use
of the Option Base statement can lead to confusion when reading
Visual Basic code and is best avoided by always explicitly specifying thelower bound of the array. This lower bound is not limited to 0 or 1,
because it can also be set by declaration. In this way, both the lower
and upper bounds are programmable. In more subscript-limited
http://en.wikipedia.org/wiki/Boolean_datatypehttp://en.wikipedia.org/wiki/Boolean_datatypehttp://en.wikipedia.org/wiki/Perlhttp://en.wikipedia.org/wiki/Perlhttp://en.wikipedia.org/wiki/Perlhttp://en.wikipedia.org/wiki/Array_data_typehttp://en.wikipedia.org/wiki/Array_data_typehttp://en.wikipedia.org/wiki/Array_data_typehttp://en.wikipedia.org/wiki/Pascal_(programming_language)http://en.wikipedia.org/wiki/Pascal_(programming_language)http://en.wikipedia.org/wiki/Pascal_(programming_language)http://en.wikipedia.org/wiki/Fortranhttp://en.wikipedia.org/wiki/Fortranhttp://en.wikipedia.org/wiki/Fortranhttp://en.wikipedia.org/wiki/Fortranhttp://en.wikipedia.org/wiki/Pascal_(programming_language)http://en.wikipedia.org/wiki/Array_data_typehttp://en.wikipedia.org/wiki/Perlhttp://en.wikipedia.org/wiki/Boolean_datatype7/28/2019 Sourabh Singh
8/76
languages, the lower bound of the array is not variable. This uncommon
trait does exist inVisual Basic. NETbut not inVBScript.
OPTION BASE was introduced by ANSI, with the standard for ANSI
Minimal BASIC in the late 1970s.
Relatively strong integration with theWindows operating systemand
theComponent Object Model. The native types for strings and arrays
are the dedicated COM types, BSTR and SAFEARRAY.
Banker's roundingas the default behavior when converting real
numbers to integers with the Round function. ? Round (2.5, 0) gives 2, ?
Round (3.5, 0) gives 4.
Integers are automatically promoted to reals in expressions involving
the normal division operator (/) so that division of one integer by
another produces the intuitively correct result. There is a specific
integer divide operator (\) which does truncate.
By default, if a variable has not been declared or if no type declaration
character is specified, the variable is of typeVariant. However this can
be changed with Deftype statements such
asDefInt, DefBool, DefVar, DefObj, DefStr. There are
12 Deftype statements in total offered by Visual Basic 6.0. The default
type may be overridden for a specific declaration by using a special
suffix character on the variable name (# for Double,! for Single, & for
Long, % for Integer, $ for String, and @ for Currency) or using the keyphrase as (type). VB can also be set in a mode that only explicitly
declared variables can be used with the command Option Explicit.
http://en.wikipedia.org/wiki/Visual_Basic_.NEThttp://en.wikipedia.org/wiki/Visual_Basic_.NEThttp://en.wikipedia.org/wiki/Visual_Basic_.NEThttp://en.wikipedia.org/wiki/VBScripthttp://en.wikipedia.org/wiki/VBScripthttp://en.wikipedia.org/wiki/VBScripthttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Rounding#Round_half_to_evenhttp://en.wikipedia.org/wiki/Rounding#Round_half_to_evenhttp://en.wikipedia.org/wiki/Variant_typehttp://en.wikipedia.org/wiki/Variant_typehttp://en.wikipedia.org/wiki/Variant_typehttp://en.wikipedia.org/wiki/Variant_typehttp://en.wikipedia.org/wiki/Rounding#Round_half_to_evenhttp://en.wikipedia.org/wiki/Component_Object_Modelhttp://en.wikipedia.org/wiki/Microsoft_Windowshttp://en.wikipedia.org/wiki/VBScripthttp://en.wikipedia.org/wiki/Visual_Basic_.NET7/28/2019 Sourabh Singh
9/76
PROGRAM 1
DEVELOP AN APPLICATION IN VISUAL BASIC TO PERFORM ARTHMETIC
OPERATIONS (+ , - ,* ,/)
DESIGN WINDOW
7/28/2019 Sourabh Singh
10/76
CODING WINDOW
7/28/2019 Sourabh Singh
11/76
OUTPUT
7/28/2019 Sourabh Singh
12/76
7/28/2019 Sourabh Singh
13/76
7/28/2019 Sourabh Singh
14/76
Program 2
Develop an application to develop to calculate simple interest.
Design window
7/28/2019 Sourabh Singh
15/76
Coding window
7/28/2019 Sourabh Singh
16/76
Output
7/28/2019 Sourabh Singh
17/76
Program 3
Design a simple calculator in v.b that takes an input basic salary and
calculate D.A,H.R.A,P.F and net salary.
D.A=basic salary
H.R.A=30% of basic salary
P.F=12% of basic salary
NET= basic salary + D.A+H.R.A+P.F.
DESIGN WINDOW
7/28/2019 Sourabh Singh
18/76
Coding window
7/28/2019 Sourabh Singh
19/76
Output
7/28/2019 Sourabh Singh
20/76
Program 4
Develop an application in visual basic to check whether the given
number is either odd or even.
Design window
7/28/2019 Sourabh Singh
21/76
Coding window
7/28/2019 Sourabh Singh
22/76
Output
7/28/2019 Sourabh Singh
23/76
Program 5
Develop an application to perform swapping of two number using the
third variable and without using third variable.
Design window
7/28/2019 Sourabh Singh
24/76
Coding window
7/28/2019 Sourabh Singh
25/76
7/28/2019 Sourabh Singh
26/76
Output
7/28/2019 Sourabh Singh
27/76
7/28/2019 Sourabh Singh
28/76
PROGRAM 6
Develop an application in visual basic to explain a use of commonly
used string function?
DESIGN WINDOW
7/28/2019 Sourabh Singh
29/76
CODING WINDOW
7/28/2019 Sourabh Singh
30/76
OUTPUT WINDOW
7/28/2019 Sourabh Singh
31/76
Program 7
Develop in application in visual basic to check whether a given number
is prime or not?
Design window
7/28/2019 Sourabh Singh
32/76
Coding window
7/28/2019 Sourabh Singh
33/76
OUTPUT
7/28/2019 Sourabh Singh
34/76
7/28/2019 Sourabh Singh
35/76
Program 8
Develop an application in visual basic to check whether a string ispalindrome or not?
Design window
7/28/2019 Sourabh Singh
36/76
Coding window
7/28/2019 Sourabh Singh
37/76
Output
7/28/2019 Sourabh Singh
38/76
Program 9
Design an application in visual basic to calculate the total marks,
percentage and grade of 5 subjects.
Design window
7/28/2019 Sourabh Singh
39/76
Coding window
7/28/2019 Sourabh Singh
40/76
Output
7/28/2019 Sourabh Singh
41/76
Program 10
Design an application in visual basic that takes as input a number from
1 to 7 and returns the corresponding week day with the help of select
case statement.
Design window
7/28/2019 Sourabh Singh
42/76
Coding window
7/28/2019 Sourabh Singh
43/76
Output
7/28/2019 Sourabh Singh
44/76
7/28/2019 Sourabh Singh
45/76
Program 11
Develop an application in visual basic to calculate sum and
Avg. of 10 no. using an array.
Design window
7/28/2019 Sourabh Singh
46/76
Coding window
7/28/2019 Sourabh Singh
47/76
output
7/28/2019 Sourabh Singh
48/76
Program 12
Develop an application in visual basic to display maximum and
minimum number of 10 values entered with the held of an array.
Design window
Design window
7/28/2019 Sourabh Singh
49/76
7/28/2019 Sourabh Singh
50/76
Program 12
Develop an application in visual basic to display maximum andminimum number of 10 values entered with the held of an array.
Design window
7/28/2019 Sourabh Singh
51/76
Coding window
7/28/2019 Sourabh Singh
52/76
OUTPUT
7/28/2019 Sourabh Singh
53/76
7/28/2019 Sourabh Singh
54/76
Program 13
Design an application in visual basic to perform matrix addition using a
two dimensional array.
Design window
7/28/2019 Sourabh Singh
55/76
Coding window
7/28/2019 Sourabh Singh
56/76
7/28/2019 Sourabh Singh
57/76
7/28/2019 Sourabh Singh
58/76
Program 14
Design an application in visual basic to generate FIBONICCI series.
Design window
7/28/2019 Sourabh Singh
59/76
Coding window
7/28/2019 Sourabh Singh
60/76
Output
7/28/2019 Sourabh Singh
61/76
7/28/2019 Sourabh Singh
62/76
Program 15
Develop a program in visual basic to generate or calculate the table of agiven number and also the factorial of a given number
Design window
7/28/2019 Sourabh Singh
63/76
CODING WINDOW
7/28/2019 Sourabh Singh
64/76
Output
7/28/2019 Sourabh Singh
65/76
7/28/2019 Sourabh Singh
66/76
Step-2 ADD 4 lable & 4text boxes in visual basic. Give the caption to
the lable same as the field name in MS- access.
7/28/2019 Sourabh Singh
67/76
Step-3 click on project menu and select components a dialog box willdisplay select Microsoft ADO data control 6.0 and click on apply.
7/28/2019 Sourabh Singh
68/76
Step 4 A new control name ADODC will be added to the toolbox
double click on this control and bring it on the form.
7/28/2019 Sourabh Singh
69/76
Step- 5 right click on the ADODC and select ADODC properties a new
dialog box will be displayed 5 tabs name general , authentication,
record source, font, colour.
7/28/2019 Sourabh Singh
70/76
Step-6 three option for source of connection will be display. A data link
file is used for DAO connectivity ODBC data source name is used for
RDO connectivity & a connection string is used for ADO connectivity.
7/28/2019 Sourabh Singh
71/76
Step-7 select the option button for used connection string and click on
build.
7/28/2019 Sourabh Singh
72/76
Step 8 choose the connection provider for connectivity the
connection provider for MS-Access is Microsoft jet 4.0 OLEDB
provider click on next.
7/28/2019 Sourabh Singh
73/76
Step 9 now select the database name. Click on text connection & if
connection is establish properly than a message with test connection
succeeded. Click on OK.
7/28/2019 Sourabh Singh
74/76
Step-10 select the record source tab of ADODC properties. Now in
command type select 2 adcmd table. Now select the name of the
table which will be display if connection is established properly. Now
click on apply than ok.
7/28/2019 Sourabh Singh
75/76
Step 11 now all the data is transfer to the ADODC to display the data
in the text boxes set the data source properties of all the data source to
ADODC and the data field property of all text boxes to individual
column name.
7/28/2019 Sourabh Singh
76/76
Step 12 Now run the application and all the data will be display in the
text boxes.