(Interview) Visual Basic Interview Questions (Page-6)

Interview : Visual Basic Interview Questions

Page - 6

What is the benefit of wrapping database calls into MTS transactions?
Aborting the transaction will undo and changes that occur within that transaction. This removes the possibility of stranded, or partial data

Describe and In Process vs. Out of Process component. Which is faster?
An in-process component is implemented as a DLL, and runs in the same process space as its client app, enabling the most efficient communication between client and component. Each client app that uses the component starts a new instance of it.
An out of process component is implemented as an EXE, and unlike a dll, runs in its own process space. As a result, exe's are slower then dll's because communications between client and component must be marshaled across process boundaries. A single instance of an out of process component can service many clients.How would you declare and raise custom events in a class?
a) Public Event OnVarChange();
b) RaiseEvent OnVarChange[(arg1, arg2, ... , argn)]

What is the difference between a Property Let and Property Set procedure?
Let - for simple variable
Set - for object

What is the difference between ANSI and UNICODE strings when passed as arguments to a DLL?
ANSI - one byte for a char UNICODE - two bytes per char - works only on NT

What is the difference in passing values ByRef or ByVal to a procedure?
ByRef -pass the address (for string -address of address of first byte)
BY REF IS VERY USEFULL When the contents itself are being modified, when there is large data. Multiple arguments are needed to be returned, instead they can be passed as reference.
ByVal -pass the value (for string -it is the address of first byte)

What is the purpose of the DoEvents command?
Fields execution so that the operating system can process other events. Returns number of open forms. Useful for things like ?cancel search? in Windows
Name and define the logical tiers in a traditional 3-tiered architecture?
Presentation logic - front end (HTML, Visual Basic forms)
Business Logic - Applications and components that encapsulate business logic
Data end - databases to store data

What is the difference between a PictureBox and Image control?
Image Control - Use this to display a picture. Use it over the PictureBox because it takes less operating system resources
PictureBox- While it can display pictures, it also acts as an area on which you can print text and graphics. Use it for home-grown graphics or print previews

Under which circumstance does a VB application ignore a Timer event?
When the system is really busy doing something else and when DoEvents is being executed

What does the NewIndex property return?
Used to retrieve the index of the item most recently added to a ListBox or ComboBox control

What is the purpose of the ClipControls property on a form or container?
Returns or sets a value that determines whether graphics methods in Paint events repaint the entire object or only newly exposed areas. Also determines whether the Microsoft Windows operating environment creates a clipping region that excludes non-graphical controls contained by the object. Read-only at run time.
What is the purpose of the AutoRedraw property on a form or container?
Setting AutoRedraw to True automatically redraws the output from these methods in a Form object or PictureBox control when, for example, the object is resized or redisplayed after being hidden by another object

Have you ever used Collections? Collection Classes?
A collection is a set of Repository objects that are all connected to a common source object via a relationship collection. A collection provides a way to connect a group of dependent objects with an object that ?contains? them. For example, an Invoice object might have a collection of LineItem objects.

What version control systems have you used?
TLIB 16-Bit add-in

How about any other database engines?
Apollo OLE DB ,Apollo Server ,Apollo SQL ,FUNCky ,R&R Report Writer

What kind of components can you use as DCOM servers?
actve-x components, Com
Dim x, y as integer. What is x and y data type?
X as variant and y as integer.

What is the size of the variant data type?
The Variant data type has a numeric storage size of 16 bytes and can contain data up to the range of a Decimal, or a character storage size of 22 bytes (plus string length), and can store any character text.

What is the return type of Instr and Strcmp?
Instr ? integer (Numeric position)
Strcmp - integer ( if both the string are equal they result = 0)
Strcmp (Str1, Str2, Comparetype)
Comparing mode = 0 ? Binary Comparing
1 ? Textual Comparing

What is the max size allowed for Msgbox Prompt and Input Box?

Max label caption length. ?

Max Text box length ?

Max Control Names length ?

Extension in Visual Basic
Frm, bas, cls, res, vbx, ocx, frx, vbp, exe
What is frx?
When some controls like grid and third party control placed in our application then it will create frx in run time.

Name some date function
Dateadd(), Datediff(), Datepart(), Cdate()

What will be the result for 15/4 and 15\4
15/4 = 3.75 and 15\4 = 3

What is keyword used to compare to objects?
ISOperator ? Returns Boolean.

How many procedures are in VB?
2. function and sub procedures. Function Will return value but a sub procedure wont return values?

Previous | Next