VB45 Unit-1
VB45 Unit-1
CA
SUB: VISUAL BASIC
UNIT - IV
Function Procedures – Sub Procedures – Advanced Uses of Procedures and Functions – Lists: One–
Dimensional Arrays – Arrays with more than One–Dimension - Using Lists and Arrays with
Functions and Procedures – The With Statement - Enums – Control Arrays – List and Combo Boxes
– Menus – Menu Editor – MDI Forms
THE ANATOMY OF A PROCEDURE:
The procedure or Subroutine is the piece of code that gets executed when the control that it
is associated with senses an event. The event means mouse click, mouse move or method invoked by
the code.
Parts of a Procedure or Subroutine:
A procedure consists of the following things:
1. Name
2. Declaration Area
3. Statements
4. Call to Other procedures and/or functions.
5. Terminator.
1. Name:
Every procedure must have a name. The name of a procedure is usually tied to the control.
You can have a procedure called cmdExit_clcik(). This means that this procedure will be executed
against the “Click” event of the “cmdExit” button. The “Sub” before the name means that the
procedure is a Subroutine.
2. Declaration Area:
This area is used to declare all the variables, constants etc. However it is considered a good
idea to declare the entire variable at the beginning of the procedure. This makes it easy to locate
variables and verify the same during the process of debugging.
3. Statements:
The procedure deals with basic execution. Procedure will contain VBA (Visual Basic
Application) statements (or code if you like) that will perform the intended task. A procedure can
have as many statements as you care to add but keeping your procedures short and simple will
render them easy to debug.
5. Terminator:
All good things come to an end. Every procedure (subroutine in the case) is terminated by the
“End Sub” statement.
Introduction to Procedures:
We can simplify programming tasks by breaking programs into smaller logical components. These
components — called procedures — can then become building blocks that let us to enhance and
extend Visual Basic.
Procedures are useful for condensing repeated or shared tasks, such as frequently used calculations,
text and control manipulation, and database operations.
There are two major benefits of programming with procedures:
Procedures allow breaking our programs into discrete logical units, each of which we can
debug more easily than an entire program without procedures.
Procedures used in one program can act as building blocks for other programs, usually with
little or no modification.
There are several types of procedures used in Visual Basic:
Sub procedures do not return a value.
Function procedures return a value.
Property procedures can return and assign values, and set references to objects.
FUNCTION PROCEDURES
Visual Basic includes built-in, or intrinsic functions, like Sqr, Cos or Chr.
In addition, we can use the Function statement to write our own Function procedures.
The syntax for a Function procedure is:
[Private|Public][Static]Function procedurename (arguments) [As type]
statements
End Function
Like a Sub procedure, a Function procedure is a separate procedure that can take arguments, perform
a series of statements, and change the value of its arguments. Unlike a Sub procedure, a Function
procedure can return a value to the calling procedure. There are three differences between Sub and
Function procedures:
Generally, we can call a function by including the function procedure name and arguments
on the right side of a larger statement or expression (return value = function()).
Function procedures have data types, just as variables do. This determines the type of the
return value. (In the absence of an As clause, the type is the default Variant type.)
We can return a value by assigning it to the procedure name itself. When the Function
procedure returns a value, this value can then become part of a larger expression.
For example, we can write a function that calculates the third side, or hypotenuse, of a right triangle,
given the values for the other two sides:
Function Hypotenuse (A As Integer, B As Integer) As String
Hypotenuse = Sqr(A ^ 2 + B ^ 2)
End Function
We can call a Function procedure the same way we call any of the built-in functions in Visual Basic:
Label1.Caption = Hypotenuse(CInt(Text1.Text), CInt(Text2.Text))
strX = Hypotenuse(Width, Height)
Example: (Function)
Public Function Sum(n1 As Integer, n2 As Integer) As Integer
Sum=n1+n2
End Sub
The function “Sum” called anywhere in the program. It can be called by simply passing the variables
to it as arguments. Consider the following event procedure.
Event Procedure:
Private Sub CmdFun1_Click()
Dim M1 As Integer
Dim M2 As Integer
Dim Tot As Integer
M1=val(Text1.Text)
M2=val(Text1.Text)
Tot=Sum(m1,m2)
End Sub
SUB PROCEDURES
A Sub procedure is a block of code that is executed in response to an event. By breaking the code in
a module into Sub procedures, it becomes much easier to find or modify the code in our application.
The syntax for a Sub procedure is:
[Private|Public][Static] Sub procedure name (arguments)
Statements
End Sub
Each time the procedure is called, the statements between Sub and End Sub are executed. Sub
procedures can be placed in standard modules, class modules, and form modules. Sub procedures are
by default Public in all modules, which means they can be called from anywhere in the application.
Example:
In this example, we create a sub procedure to sum up two values that are specified by the arguments
The main program can reference a procedure by using its name together with the arguments in the
parentheses.
Private Sub cmdCal_Click()
Dim x As Single, y As Single
x = Val(TxtNum1.Text)
y = Val(TxtNum2.Text)
sum x, y
End Sub
Note that when we use the Call syntax, arguments must be enclosed in parentheses. If we omit the
Call keyword, we can also omit the parentheses around the arguments.
Print 10 * ToDec
X = ToDec
If ToDec = 10 Then Debug.Print "Out of Range"
X = AnotherFunction(10 * ToDec)
It's also possible to call a function just like we would call a Sub procedure. The following statements
both call the same function:
Call Year(Now)
Year Now
When you call a function this way, Visual Basic throws away the return value.
Call Form1.SomeSub(arguments)
If two or more modules contain a procedure with the same name, we may need to qualify it with the
module name. A call to a common procedure from the same module runs the procedure in that
module. For example, with a procedure named CommonName in Module1 and Module2, a call to
CommonName from Module2 will run the CommonName procedure in Module2, not the
CommonName procedure in Module1.
A call to a common procedure name from another module must specify the intended module. For
example, if you want to call the CommonName procedure in Module2 from Module1, use:
Module2.CommonName(arguments)
For example:
Sub PostAccounts(ByVal intAcctNum as Integer)
.
. ' Place statements here.
.
End Sub
If we specify a data type for an argument passed by reference, we must pass a value of that type for
the argument. we can work around this by passing an expression, rather than a data type, for an
argument. Visual Basic evaluates an expression and passes it as the required type if it can.
The simplest way to turn a variable into an expression is to enclose it in parentheses. For example, to
pass a variable declared as an integer to a procedure expecting a string as an argument, you would do
the following:
Sub CallingProcedure()
Dim intX As Integer
intX = 12 * 3
Foo(intX)
End Sub
Example 1:
Dim Num(5) As Integer
“Num” is the set of 6 integers.
Nums(0) is the first element.
Nums(5) is the sixth and the last element.
The numbers inside the parentheses of the individual variables are called subscripts, and each
individual variable is called a subscripted variable or element. The elements of an array are assigned
successive memory locations. The following figure shows the memory location for the array Num(5)
Example 2:
Dim X(10 To 20) As Integer
“X” is the set of 11 integers.
X(10) is the first element.
X(20) is the eleventh and the last element.
ONE-DIMENSIONAL ARRAYS:
Declaring Fixed Size Arrays:
The scope of the array will depend upon the method of declaration.
1. To create a local array, use the Dim statement in a procedure to declare the array.
Dim Sum(10) As Single
2. To create a Module array, use the Private statement in the Declaration section of a
module to declare the array.
Private Ser(10) As Single
3. To create a Public array, use the Public statement in the Declaration section of a form.
Public Sun(10) As Single
4. In the case of fixed – size array it is compulsory to enter the upper bound of the array in
the parenthesis.
5. The upper bound is the upper limit for the size of the array.
To specify the lower bound of an array, provide it explicitly (as a long data type) using the TO
keyword.
Dim Counter(1 to 10) As Integer
In the above declaration, the index numbers of counter range from 1 to 10. The LBound is a
function that returns the lower bound of an array.
Example
Dim X As Integer
Dim SinX(24) As Integer
X=Lbound(SinX)
Debug.Print X
Dynamic Arrays:
Dynamic arrays are used when the user doesn’t know the number of elements of an array.
Advantages:
1. A dynamic array can be resized at any time and this helps us to manage memory
efficiently.
2. We can use a large array for a short time and then a free memory to the system when
we are no longer using the array.
3. We can increase the size of the array after having declared a smaller array.
ReDim: ReDim is used to declare the array as dynamic by giving it an empty dimension list.
Declaring a Dynamic Array:
We declare the array as dynamic by giving it an empty dimension list
Dim a()
Use the ReDim statement to allocate the actual number of elements.
ReDim a(11,4)
Example:
Dim a() As Integer
ReDim Statement: The ReDim statement is used at procedure level to relocate storage space for
dynamic array variables.
Syntax:
More on ReDim:
Only the upper bound of the last dimension in a multidimensional array can be changed when we use
the Preserve keyword. If we change any other dimension, a run-time error will occur.
Example:
Dim a(11,2,4) As Integer
It can be resized using the Preserve keyword.
Example:
This example uses the ReDim statement to allocate and reallocate storage space for dynamic
array variables.
Private Sub Form_Load()
Dim a() As Integer
ReDim a(5)
For i= 1 to 5
a(i)= i
Next i
End Sub
ENUMS
An enumeration, or Enum , is a symbolic name for a set of values. Enumerations are treated as
data types, and we can use them to create sets of constants for use with variables and properties
Declare Enum
An Enum type has a name, an underlying type, and a set of fields, each representing a constant.
The name must be a valid Visual Basic qualifier. The underlying type must be one of the integer
types—Byte, Short, Long or Integer. Integer is the default.
Example:
Public Enum Days
Sunday=1
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
End Enum
CONTROL ARRAYS
Array is the collection of similar elements. Control Array is nothing but, collection of similar
controls. These controls are the elements of the Control array, which share the common properties.
There are three ways to create control arrays in Visual Basic, are
Using CTRL+C, CTRL+V to copy an existing control from one place on the form to another
Using the same control name for the controls in the form, more than once while designing a
visual basic application.
Using the index property of the controls
Working with a Control Array
Change procedure of a control present in the control array is different from the change procedure of
the ordinary control. The Change procedure of the control Array will have index as parameter. This
parameter is the key to the smooth functioning of control arrays.
Adding and Removing Controls in a Control Array
We can inadvertently add a control to a control array at design time; we can also remove it by
changing the control name or deleting the control at design time. The nifty part is that once
we’ve created array at design time, we can add controls while the application is running. To do
this, we use a method called Load
The Syntax for Load method is
Load ControlArrayName (Index)
Suppose we want to add three textboxes in the control array at run time, where there is a textbox
already created at run time. We have to write the following code to the form_load event procedure to
add three textboxes at runtime.
Private Sub Form_Load()
Dim I As Integer
Const Spacing = 10
Text1(0).Move 0, 0
Text1(0).Text = "Text box in control Array #0"
Text1(0).Width = TextWidth(" Text box in control Array # 0 ")
For I = 1 To 3
Load Text1(I)
Text1(I).Text = "Text box in control Array #" + Str(I)
Text1(I).Width = TextWidth(" Text box in control Array # " + Str(I))
Text1(I).Move 0, Text1(I - 1).Top + Text1(I - 1).Height + Spacing
Text1(I).Visible = True
Next I
End Sub
At run time, we have to set the Visible property of the new control to true or else the new elements
will not appear on the form. We should properly position the controls in the form using the Move
method, this means that the newly created controls in a control array default to being stacked one on
top of the other.
The UnLoad Method is used to remove the controls from the control Array at run time
The Syntax of the UnLoad method is
UnLoad ControlArrayName(Index)
The following code will remove the text boxes from the control array which are created during run
time.
Private Sub Form_Click()
Static J As Integer
If J < 3 Then
Unload Text1(J + 1)
J=J+1
Else
Exit Sub
End If
End Sub
Using ComboBox
A Combo Box combines the features of Textbox. This control enables the user to select either by
typing text into combo box or by selecting an item from list.
There are three types of Combo Box styles that are given below.
1. Dropdown Combo (style 0)
2. Simple Combo (style 1)
3. Dropdown list (style 2)
We select which type we want with the combo box Style property
A combo box is a combination of a text box and list box, so that at design time, we can change the
text in the text box part by changing the Text property.
At run time we add items in the combo box using AddItem method
Example:
Private Sub Form_Load()
cmb1.AddItem "test1"
cmb1.AddItem "test2"
cmb1.AddItem "test3"
End Sub
MENUS
Creating and managing menu at Design Time:
Visual Basic applications can be enhanced by adding menus to it. It offers a convenient and
consistent way to group commands and easy way for users to access them.
The menu bar appears appear below the title bar and it may contain one or more menu
titles. When a menu title is clicked it displays a set of menu items under that title. Each menu
item corresponds to a menu control that is defined in a menu editor and performs a specific
action.
MENU EDITOR
A menu editor can be used to add new commands to the existing bars. A menu editor can be added
only after opening a project. To display a menu editor command is chosen from the Tools menu or
menu editor button is clicked in the tool bar.
Shortcut Keys
Shortcut keys are similar to access key has a special meaning in menu design, but inside a opening
menu, they run a command when pressed. To assign a shortcut key to a menu command, dropdown
the shortcut list in the menu editor and select a keystroke.
Run the application by pressing F5. We can see that you can select a menu
MDI FORMS:
MDI stands for Multiple Document Interface.
The Multiple Document Interface (MDI) was designed to simplify the exchange of
information among documents.
Each document is displayed in its own window, and all document windows have the same
behavior.
The main Form, or MDI Form, isn't duplicated, but it acts as a container for all the windows,
and it is called the parent window.
The windows in which the individual documents are displayed are called Child windows.
An MDI application must have at least two Form, the parent Form and one or more child
Forms. Each of these Forms has certain properties.
There can be many child forms contained within the parent Form, but there can be only one
parent Form.
The parent Form may not contain any controls.
While the parent Form is open in design mode, the icons on the ToolBox are not displayed,
but can't place any controls on the Form.
The parent Form usually has its own menu.
To create an MDI application, follow these steps:
1. Start a new project and then choose Project >>> Add MDI Form to add the parent Form.
2. Set the Form's caption to MDI Window
3. Choose Project >>> Add Form to add a SDI Form.
4. Make this Form as child of MDI Form by setting the MDI Child property of the SDI Form to
True. Set the caption property to MDI Child window.
When we click MDI Open we can notice that the main menu of the MDI Form is replaced with the
Menu of the Child Form.
UNIT – V
Introduction to Database - Working with Data Control: The Data Control - The Bound Control –
Coding – Data Access Object: Functions of the Jet Database Engine – The DAO Object Model -
Crystal and Data Reports: Crystal Report - Data Report – Creating Multiple Reports
INTRODUCTION TO DATABASE
Definitions:
Database
"A set of data related to a particular topic or purpose. A database contains tables and can
also contain queries and table relationships, as well as table and column validation
criteria."
Table
"A table is a collection of data, arranged in rows and columns. For example, you might
have a table for author information called authors. Each column would contain a certain
type of information, such as the author's last name. Each row would contain all the
information about a specific author: first name, last name, address, and so on."
Recordset
A recordset is an object that contains a set of records from the database. There are mainly
five types of Recordset object.
1. Table-Type Recordset: The table type recordset object is a set of records that
represents a single table can be used to add, change or delete records. They are
fastest type of Recordset.
2. Dynaset-Type Recordset: The dynaset-type recordset object is a set of records
that represent a table, or attachment tables, or the results of queries containing
fields from one or more tables. A dynaset enables us to update data from more
than one table.
3. Snapshot-Type Recordset: the snapshot type recordset can refer any table,
attached table or query. A snapshot cannot be updated and does not reflect
changes to data made by the users.
4. Dynamic type Recordset: This recordset type represent a query result set from
one or more base tables in which we can add, change or delete records from a row
returning query. Further, records that other users add, delete, or edit in the base
tables also appear in our recordset. This type is only available in ODBCDirect
workspace, and corresponds to an ODBC dynamic cursor.
5. Forward Only Type recordset: This recordset type is identical to a snapshot
except that we can only scroll forward through its records. This improves
performance in situations where only need to make a single pass through a result
set. In an ODBCDirect workspace, this type corresponds to an ODBC forward-
only cursor.
VB Data Control:
VB provides two controls which makes the link to the database file and which creates the
recordset that is exposed to the rest of the controls in your application. The two are identical in
concept but differ in the flexibilty they offer to the programmer.
1. Data control:
This is the original, intrinsic version of the control. It supports the JET database engine
and can satisfy most beginners' needs.
2. ADO Data control:
This is the latest version of the data control, implemented as an ActiveX control.
4. Start by drawing a Data control at the bottom of the Form. The Data control is your
gateway to the database.
5. With the Data control selected, locate its DatabaseName property, and set the path to
st_detail database.
6. Locate the RecordSource property in the Properties window, and drop down the list of
available entries. You’ll see a list of all the tables in the st_detail database. Select the
student table.
7. Place three textboxes on the Form.
8. Select the first textbox, and in the Properties window locate its DataSource property. Set
it to Data1.
9. Set the DataField property of the textbox to Name. The DataField property is a drop-
down list with the names of all fields in the student table.
10. Set the DataSource property of the other textboxes to Data1, and set the DataField
property to Roll No, and Class.
Now run the application. The textboxes will display the values of the corresponding fields of the
student table. Using the Data control’s buttons, you can move through the records (rows) of the
table. Clicking the leftmost button displays the first record of the table, and clicking the button
next to it displays the previous record. Clicking the rightmost button displays the last record of
the table, and clicking the button next to it displays the next record.
• Picture boxes
• Labels
• Text boxes
• Checkboxes
• Image controls
• OLE controls
• List boxes
• Masked edit controls
• Rich text boxes
• Combo boxes
In addition, there are special controls that are designed to be used as bound controls:
• DBList
• DBCombo
• FlexGrid
• MSFlexGrid
Finally, a number of bound controls are specially built to be used with the ADO control only:
• DataList
• DataCombo
• DataGrid
DAO objects encapsulate Access's Jet functions. Through Jet functions, it can also access other Structured
Query Language (SQL) databases.
The DBEngine is the highest-level object in the DAO object model. It contains all other objects and
collections. The Database object is the member of the Databases collection of the default Workspace
object, which is a member of the Workspaces collection of the DBEngine object.
With DAO, objects you use to work with the data in the database are generally not saved but are created
every time you need them. Objects that represent the structure of the database are saved with the database.
When you create a new DAO object to be saved in the database, you have to append it to the appropriate
collection using the collection's Append method. Keep in mind that all DAO objects are indexed
beginning with zero.
Jet and ISAM data use the Microsoft Jet object model; however, with ODBC data, you can use either
Microsoft Jet or ODBCDirect. There are some limitations in accessing ODBC data using Jet, although
you can use it if you need to take advantage of a particular Jet feature. But ODBCDirect is more flexible,
allowing you to run queries or stored procedures against the backend server and perform batch updates
and asynchronous queries. It also makes your application run faster because it allows you to bypass
Microsoft Jet's middle layer.
The DBEngine object contains two collections: Workspaces and Errors. The Workspaces collection is the
default collection of the DBEngine, so you don't have to refer to it explicitly. When you don't specifically
create a new Workspace object, DAO will create one for you. The setting of the DefaultType property of
DBEngine determines what type of workspace is created for Microsoft Jet or ODBCDirect. The default
value of this property is dbUseJet, but you can explicitly set it to dbUseODBC as the type argument of the
CreateWorkspace method.
The Workspace object defines a session for a user based on users' permissions and allows managing of
the current session. It also contains open databases and offers mechanisms for simultaneous transactions
and for securing the application. The Fields collection is the default collection for TableDef, QueryDef,
Index, Relation, and Recordset objects. Recordset objects can be of the following types: Table, Dynaset,
Snapshot, or Forward-Only.
Click on the Custom button to display the Choose Report Type and Data Type frames.
Select the Custom Report and click on the Data File.
Specify the location of the BIBLIO.MDB Access database.
Select which tables from the database you want. For this example we will need the authors table
and the Title table.
Check that the joins are correct in the Linking Export.
Now we are ready to draw the report.
Drag and drop the fields you want on to the report. So that it looks like the report above.
Now if you run it by selecting Print Preview, you can see what the report looks like.
Now save the report and we have a template that now can be used in VB.
There are many options in the Crystal Reports and as this tutorial is more of an overview I will not be going
into it. But one important thing to do is to get specific data. This is done by a selection formula (i.e. the Where
clause of a SQL statement).
The above formula will only show Authors that have had their book published in 1984.
2.Data Reports
We can create a Data Report. We will drag things out of the Data Environment onto a form
created for the Data Report, so make sure your Data Environment window is still available.
On the Project menu, click Add Data Report and one will be added to your project. If this item is
not on the menu, click Components. Click the Designers tab, and choose Data Report and click
OK to add the designer to your menu.
Set the following properties for the report:
Name: rptPhone
Caption - Phone Directory
DataSource - denPhone (your phone data environment - choose, don’t type)
DataMember - PhoneList (the table name - choose don’t type)
Right-click the Data Report and click Retrieve Structure. This establishes a report format based on the
Data Environment.
Note there are five sections to the data report: a Report Header, a Page Header, a Detail section, a Page
Footer, and a Report Footer. The headers and footers contain information you want printed in the report
and on each page. To place information in one of these regions, right-click the selected region, click Add
Control, then choose the control you wish to place. These controls are called data report controls and
properties are established just like you do for usual controls. Try adding some headers.
The Detail section is used to layout the information you want printed for each record in your database.
We will place two field listings (Name, Phone) there. Click on the Name tab in the Data Environment
window and drag it to the Detail section of the Data Report. Two items should appear: a text box Name
and a text box Name (PhoneList). The first text box is heading information. Move this text box into the
Page Header section. The second text box is the actual value for Name from the PhoneList table. Line this
text box up under the Name header. Now, drag the Phone tab from the Data Environment to the Data
Report. Adjust the text boxes in the same manner. Our data report will have page headers Name and
Phone. Under these headers, these fields for each record in our database will be displayed. When done,
the form should look something like this:
In this form, I’ve resized the labels a bit and added a Report Header. Also, make sure you close
up the Detail section to a single line. Any space left in this section will be inserted after each
entry.
Click File and Save rptPhone As. Save the environment in an appropriate folder. We will now
reopen our phone database manager and attach this and the data environment to that project and
add capabilities to display the report.
Accessing the Data Report
Reopen the phone directory project. Add a command button named cmdReport and give it a Caption of
Show Report. (There may be two tabs in your toolbox, one named General and one named DataReport.
Make sure you select from the General tools.)
We will now add the data environment and data report files to the project. Click the Project menu item,
then click Add File. Choose denPhone and click OK. Also add rptPhone. Look at your Project Window.
Those files should be listed under Designers.
Use this code in cmdReport_Click:
Private Sub cmdReport_Click()
rptPhone.Show
End Sub
This uses the Show method to display the data report.
Save the application and run it. Click the Show Report button and this should appear:
3. Multiple Report
To create a report
In Visual Studio, create or open a Report Server project. For more information, see Create a
Report Server Project for Visual Studio ALM.
On the Project menu, choose Add New Item.
o The Add New Item dialog box appears.
Choose Report Wizard, and then choose Add.
o The Report Wizard opens to the Select Data Source page.
Choose the Tfs2010OlapReportDS shared data source, and then choose Next.
o Even though you might have installed or upgraded to TFS 2013, these names, which were
assigned to the data sources for TFS 2010 are in use.
UNIT II
2 MARKS
1. Define: Fixed length strings
2. What is a variable?
3. Define the term project
4. What is a textbox?
5. What is a project in VB?
6. Name the four windows displayed on entering VB.
7. What is Visual Programming
8. How is Visual basic Project Saved?
9. State any four data types used in VB-Numeric, String, Date and Variant
5 MARKS
1. What are the steps used for changing the properties of VB form? Explain
2. Discuss the tools used in the toolbox.
3. Explain the methods used to save a form
4. Discuss the properties of text boxes
5. Define a form and explain the following a) Command button b) List box c) Text boxes
6. Create a student detail form in VB with details of students like name, dob, degree, address, phone. Using
labels, text boxes and command buttons to add or delete students
10 MARKS
1. Explain the various properties of Command buttons
2. Explain the data types available in Visual basic.
3. Explain the properties windows also explain the use of the form’s Properties window.
4. What is IDE? Discuss about the features of IDE?
UNIT III
2 MARKS
1. List out the relational operators
2. Write the syntax of do loop
3. What the syntax of a format function.
4. What is the purpose of the Dim Statement?
5. Write the syntax of NPV function.
5 MARKS
1. Explain the functions of if-then-else loop with example
2. Discuss any five numeric functions with example.
3. Explain the properties of rich text boxes.
4. Draw the flow diagram of for-next loop.
5. What are functions? Explain the use of the following strcmp, strlen, sqr, exp, log, abs
6. Differentiate if statement from select case statement in VB giving suitable examples and their syntax.
7. Describe the four variations of a Do…loop structure.
8. Explain the structure of select case.
9. Explain numeric and date & Time function with example.
10. Explain the Financial function used in Visual Basic
10 MARKS
1. Give an account of sub procedures
2. Discuss the various string functions.
UNIT IV
2 MARKS
1. What is procedure?
2. What is function procedure ?
3. What is sub procedure?
4. What is object browser?
5. What is sub program?
6. What is list?
7. What is array?
8. What is record?
5 MARKS
1. Write a short note on function procedures?
2. Write a short note on sub procedures?
3. Explain about object browsers?
4. Explain about user defined types?
5. Explain about one dimensional arrays?
10 MARKS
1. Explain in detail about advanced procedures and functions.
2. Explain about multi dimensional arrays.
3. Explain the new array based strings.
UNIT V
2 MARKS
1. What is database?
2. What are crystal reports?
3. What is data report?
4. What is OLE DB provider?
5. What is data report
6. What is an ActiveX control?
7. What is table?
8. What are fields?
9. What is web page?
5 MARKS
1. How do you creating a crystal report using vb?
2. How do you create a data Report?
3. Write a short note web page?
10 MARKS
1. Create a sample databases & designing a report?
2. How do you creating multiple reports in VB? Explain In detail.
3. Create a simple application programs for inventory control?
4. Explain in detail about ActiveX control?