You are on page 1of 7

Subject: Informatics (065) Ms.

Kanchan(KHMS)
Visual Basic (XI+XII)
Viva Questions
Q1. What is interface?
Ans. Interface is the visual part through which user interact with application.
Q2. What is control?
Ans. The icons with which the user interacts are called control.
Q3. What are various types of control available in VB?
Ans. (A) Intrinsic control: The control that always found on toolbox.
(B) Active X control: It is interactive objects that can reside on any form that

support OCX (OLE control) controls. e.g. Some standard Active X controls

are: ADO Data Control, Data List, Common Dialog etc.


(C) Insertable Objects: In this, other objects can be added to the toolbox such as

Microsoft Excel etc.


Q4. What do you understand by a message and event?
Ans. Event: - Refers to the occurrence of an activity.
Message: - Is the information/request sent to the application.
Q5. What are properties in VB?
Ans. Properties are characteristics of an object that control its appearance and
/or behavior.
Q6. What is the relationship between properties, methods and events?
Ans. Properties: is an object attributes, Method: as its action and event: as its
responses.
Q7. What is a container control?
Ans. It is a control that can hold another control within it.e.g.Frame,
PictureBox, form etc.
Q8. What does following statements do in VB?
Ans. Show: - Display a form that is currently not visible. This method
automatically loads the form, if it is not loaded in memory already.
Load: - used to load a form in memory programmatically.
Unload: - Used to remove a form from memory and release the memory space it
was occupy, in loaded state.
Hide: - Used to make a visible form invisible. The hidden form continues to
reside in memory.
Q9. What is the difference between SDI and MDI interfaces?
Ans. MDI (Multiple Documents interface) allows the user to open multiple windows
at the same time. e.g. MS-Word is MDI application.
SDI (Single Documents interface) allows the opening of single windows at any
point of time. e.g. In window Notepad, only one data document can be opened at a
time.
Q10. Timer control generate just one event name it?
Ans. Timer event .
Q11. What is focus? When do GotFocus and LostFocus event occur?
Ans. Focus is the ability to receive user input through mouse or keyboard. When
an object has the focus, it can receive input from a user. The GotFocus event
occurs when an object receive focus. The LostFocus event occurs when an object
loses focus.

Page 1 Made By Ms. Kanchan Khurana

Subject: Informatics (065) Ms. Kanchan(KHMS)


Q12. What is control array?
Ans. It is a group of control created on the same form, having same name and
type. The control in a control array is distinguished on the basis of a property
called index.
Q13. Name the three file system controls?
Ans. (1) Drive List Box (2) Directory List Box (3) File List Box.
Q14. Name the control that cannot receive Focus?
Ans. Frame, Image, label, Shape and Timer control.
Q15. What is Data Control?
Ans. A Data Control is a control used to connect a VB application to a database.
Q16. List some important properties of a Data Control?
Ans. Databasename, Exclusive, RecordSource, ReadOnly.
Q17. Name some invisible control?
Ans. Timer control, Common Dialog control, Image List.
Q18. What is bound control?
Ans. Bound control is the control that can provide access to a specific column or
columns in a data source through a data control or through remote data. The bound
controls are CheckBox, images, Label, PictureBox, TextBox.
Q19. Name three common properties of bound control?
Ans. Datasource, DataField and Datachange
Q20. How PictureBox and Image controls are differ?
Ans. PictureBox can also act as a container for other controls that an image
control cannot do.
Q21. What is a ToolBar?
Ans. A ToolBar is a container for buttons that generally correspond to frequently
used commands in an application’s menu.
Q22. What is a StatusBar?
Ans. StatusBar is a frame that contains various panels to inform the user about
the status of an application.
Q23. What is a Status Bar Panel?
Ans. It is a section of status bar that is used to display information about a
particular attribute of the application.
Q24. What is Separator Bar?
Ans. A bar on a menu that divides menu items into logical group is called a
Separator Bar. It is used fro clarity and for dividing logically related menu
items into logical groups.
Q25. What are dynamic menus?
Ans. Dynamic menus are menus to which menu items can be added or removed at
runtime.
Q26. What is OLE?
Ans. OLE stands for object linking and Embedding. OLE is a way to link different
applications. The application whose object is placed in other application is
called source document and the document where this object is placed is called the
destination document.
Q27. What is embedded object?
Ans. Embedded object is an object in a destination document that is a copy of
information, created in another application.

Page 2 Made By Ms. Kanchan Khurana

Subject: Informatics (065) Ms. Kanchan(KHMS)

Q28. What for is an OLE container control used?


Ans. The OLE container control enables us to add insertable objects to the form
in our VB application.
Q29. What is the difference between linked and embedded object?
Ans. An embedded object is placed in the destination document in complete form
and it become part of the destination document.
A linked object, on the other hand is actually a way to establish link
between source and destination document. In this, an object is not placed in
destination document; rather a link is placed here.
Q30. What is a Recordset?
Ans30. Recordset is a temporary table (dummy table), created in main memory,
by VB to hold the data generated by a data source (e.g. a data control).
Q31. What do you understand by implicit and explicit declaration?
Ans31. Implicit declaration means usage of variable without declaring it, i.e.
VB implicit declares its type to be variant.
Explicit declarations means all variable must be declared before using it.
It can be enforced by typing Option Explicit at the top of the module can enforce
it.
Q32. What is Modal and Modeless Form?
Ans32. Modal Form is one that takes total control of the application and does
not let the user work with other application until it is closed.
Modeless Form on the other hand allows the user to interact with the other
application/switching to any other forms.
Q33. What is ADO?
Ans33. ADO expands to ActiveX Data Objects. It is an application program
interface from Microsoft, which is used with windows applications to get access to
relational as well as non-relational database.
Q34. What is OLDB?
Ans34. OLEDB is a set of interfaces that provides uniform access to data stored in
diverse data stores; using OLEDB one can access all types of databases in the same
manner.
Q35. What is Data Provider?
Ans35. A data provider is a control, a set of objects or a mechanism that
provides data to applications by connecting to a data store.
Q36. What os ODBC?
Ans36. ODBC (Open Database Connectivity) is an application-programming
interface that enables application to access data from a variety of existing data
source.
Q37. Name some data aware controls: -both intrinsic and ActiveX controls?
Ans37. (A) Intrinsic:- TextBox, CheckBox, Label, ListBox etc.
(B) ActiveX:-DataGrid, Datalist, MsflexGrid etc.
Q38. Name some major object involved in ADODB processing?
Ans38. (i) Connection object (ii)command object (iii)Recordset
Q39. List any three methods of the connection objects?
Ans39. Open, Execute, Close.
Q40. List at least four properties of a connection object?
Ans40. (i) Connection String. (ii) Provider (iii) Cursor Location (iv)
Connection Timeout
Page 3 Made By Ms. Kanchan Khurana

Subject: Informatics (065) Ms. Kanchan(KHMS)

Q41. What is DSN?


Ans41. DSN (Data source Name) is a logical name used by ODBC to store the
information required to access a data store. A DSN once created can be used later
also for accessing data from it connected data store.
Q42. Which command type would you specify as the data source for the following
requirements?
Ans42.
i. Entire table data is required: -adcmdTable.
ii. A store procedure is to be executed: -adCmdStoredProc.
iii. SQL command is to be executed: -adCmdText.
iv. Source of data is unknown: - adCmdUnknown.
Q43. How would you obtain the no of records in a ecordset?
Ans43. RecordCount property of Recordset.
Q44. Using what method SQL query can be run on connection object?
Ans44. Execute.
Q45. Compare Selection construct with iteration construct in VB?
Ans45.
Selection Construct Iteration Construct
1. These construct are used for branching the control flow depending upon a
certain conditions. 1.These constructs are used fo rrepeating a set of
statements depending upon a certain conditions.
2. Selection construct available in VB are IF,IF---else, nested IF, Select Case
etc. 2. Iteration construct available in VB are For---Next,Do—while,Loop

Q46. Discuss various Loop-Types in VB with example?


Ans46. VB supports two basic loop-types:-
(i) Entry-Controlled/Pre-Tested/Top-Tested Loop:-
These loops are first tested for execution before the loop body executes. e.g. Do
While--Loop, For--- Next,While---Wend.
(ii) Exit-Controlled/Post-Tested/Bottom-Tested Loop:-
are the ones which are tested for execution after the loop body executes. e.g. Do—
Loop until, Do---Loop while.
Q47. What is a procedure?
Ans47. A procedure is a named unit of a group of program statements that
perform a well-defined task. It can be invoked other parts of the program. In
other words a procedure is a named code block that is created to do a well-defined
task.
Q48. How many types of procedure are available in VB?
Ans48. There are several types of procedure are available in VB:-
(i) Sub-Procedure: - is a procedure that performs a task but does not return a
value.
(ii) Event-Procedure: - is a sub-procedure associated with a specific event of an
object. It gets invoked when specific event occurs for its object. E.g. Cmd_ok
click ()
(iii) Property-Procedure: - are the procedures used for reading/setting of an
object’s property value.
Page 4 Made By Ms. Kanchan Khurana

Subject: Informatics (065) Ms. Kanchan(KHMS)

(iv) General-Procedure: - is a procedure written by a programmer to solve an


application specific problem. It is invoked when a call statement is executed for
it.
Q49. What are actual and formal parameters?
Ans49. Actual parameters are those, which appear in the statement invoking the
procedure function where as formal parameters are those which appear in the
definition of the procedure function.
Q50. What do you mean by scope of a variable?
Ans50. The scope or visibility of a variable is the portion of code from which
that variable can be accessed.
Q51. What do you mean by lifetime of a variable?
Ans51. It is the time period during which that variable stays alive and
occupies memory.
Q52. How many types of scopes are supported in VB?
Ans52. (i) Local Scope: - Variable can only be used in procedure/function in
which it is
defined.
(ii)Global Scope: - Variable can be used globally I.e. throughout the application.
(iii)Module Scope: - Variable can be used in all procedure/function defined in the

module which contains the definition for the variable.


Q53. What are various advantages of using procedure in VB application?
Ans53.
(i) Reduction in size of source code.
(ii) Reduction in size of compiled code.
(iii) Program becomes more maintainable.
(iv) Logic becomes more understandable.
Q54. Differentiate between following: -
Ans54.(A) Private/Local Variables and Public/Global Variable
Private/Local Variables Public/Global Variable
(1) These variable are usable and available only from the code within their own
procedure. (1) These variable are usable and available in all procedure within an
application.
(2) They lose their value as soon as the execution of their parent is over. They
retain their value throughout an application.

(B) Private/Local Procedure and Public/Global Procedure


Private/Local Procedure Public/Global Procedure
(1) These procedure are usable and available only from the code within their own
module (1) These procedure are usable and available in all modules within an
application.

(C ) Local Variable and Stacic Variable


Local Variable Static Variable
(1) They lose their value as soon as execution of their parent is over (1) They
retain their value even after their parent procedure is over
(2) Their lifetime is function/procedure run. (2) Their lifetime is application
run

Page 5 Made By Ms. Kanchan Khurana


Subject: Informatics (065) Ms. Kanchan(KHMS)

Q55. Name two ways in which arguments can be passed to procedures?


Ans55. (1) By value (ii) By Reference
Q56. How is pass by value is different from pass by reference in terms of
variable
passed?
Ans56.
Pass by value Pass by reference
(1) A copy of actual parameters is passed to the called procedure. (i)
Reference to the actual parameters is passed to the calling procedure.
(2) The original content of the passed variable (actual parameters) are not
affected by the called procedure/function. (2) The original content of the
passed variable (actual parameters) are affected by the changes made in the called
procedure/function.

Q57. What do you understand by parameters or arguments?


Ans57. A parameters or an argument is the data passed from a calling program
to the called program.
Q58. What do you understand by optional arguments?
Ans58. An optional arguments is the one to which the calling program might or
might not pass a value while invoking a function/procedure.
Q59. How is event procedure different from general procedure?
Ans59. Event procedure is invoked by the runtime, in response to a user
action or some internal activity.
General procedure on the other hand needs to be invoked explicitly by the
programmer.
Q60. What is a function?
Ans60. A function is a named block of code, which apart from doing a well-
defined task, return some calculated value to the calling program/procedure.
Q61. How is function similar to and different from a procedure?
Ans61. Both function and procedure are general procedure that perform a
specific task, can take arguments, perform a series of statements and change the
value of its arguments.
A function however, can return a value to the calling procedure whereas a
sub-procedure cannot return any value.
Q62. What is module?
Ans62. A module is a container of many declarations and code.
Q63. What types of modules are available in VB?
Ans63. There are three types of modules are available in VB
(i) Form Module: -
a) All the form that are added to a VB application are example of from module.

b) These module have two types of views(design and code view)


c) These modules are saved with extension .frm.
(ii) Standard Modules: -
a) Module that has no user interface and is used to group certain procedure or
declaration are called standard module.
b) These module store general purpose code of application i.e. that are not
specific to one single form of the application.

Page 6 Made By Ms. Kanchan Khurana

(iii) Class Modules: -


a) A module that is used to create a user-defined data-type that can have
properties, vents, general procedure etc. associated with it.
b) Class module is stored with extension .cls.
Q64. What are library/Built in function?
Ans64. Functions that are predefined and already available in VB are called
library/built-in –function.
Q65. What are various built-in-function in VB?
Ans65. (I) String Function (II) Numeric Function (III) Date/Time
function

Q66. Explain various String-Function with example?


Ans66. Functions Description
1. Lcase(“STUDENT”)=student
Description:- (convert given string into lowercase letters)
2. Ucase(“student”)=STUDENT
Description:- (convert given string into uppercase letters)
3. Len(“STUDENT”)=7
Description:-(Find length of given string)
4. Ltrim(“$$$student”)=student
Description:- (Remove spaces from left side of given string)
5. rtrim(“student$$$$”)=student
Description:-(Remove spaces from right side of given string)
6. Trim(“$$student$$$”)=student
Description:- (Remove spaces from both side of given string)
7. Left(“VIDU PRIYA SHARMA”,5)=VIDU
Description:- (Extract 5 leftmost character from given string)
8. Right(“VIDU PRIYA SHARMA”,6)=SHARMA
Description:- (Extract 6 rightmost character from given string)
9. Mid(“VIDU PRIYA SHARMA”,3,6)=DU PRI
Description:- (Extract characters starting from 3 postion to 6th position
character
from given string)
Mid statement is also replace extract characters with text you specify
e.g. Sinput=”VIDU $ SHARMA”
Mid(sinput,5,1)=’-“
Ans=VIDU-SHARMA.
In this example $ replace with ‘-‘ character at 5th postion
10. Instr(4,”INFORMATICS”,’s’,1)=11
Description:- (Searched character s in given string starting searching from 4th
character onwards by ignoring case)
11. Instr(2,”INFORMATICS”,’s’,0)=0
Description:- (Searched character s in given string starting searching from 2nd
character onwards by considering case)
If Last argument in INSTR( ) is mission that is 1 or 0 then it is zero by default.

12. String(5,”*”)=*****
Description:- (Print given character given no of times)
13. String(4,”ABC”)=AAAA
Description:- (Print first character given no of times from a string)
14. String(6,66)=BBBBBB
Description:-(Print character B(because ASCII value of B is 66 given no of times)

Page 7 Made By Ms. Kanchan Khurana


15. STR(1302)=”1302”
Description:-(Convert a number into string)
16. StrReverse(ANITA SHARMA”)=ATINA AMRAHS
Description:-(Reverse the given string)
17. CHR(65)=A
CHR(97)=a
Description:-(Return a string conating the charcter associated with specified
character code)
18. ASC(“AMAR”)=65
ASC(“delhi”)=100
Description:-(Return a ASCII value of first character of a given string)