These material are compiled for helping junior / senior software engineers and others.

1. How do you register a component?

Compiling the component, running REGSVR32 MyDLL.dll

2. Name and explain the different compatibility types when creating a COM component

No Compatibility ? New GUID created, references from other components will not workProject Compatibility ? Default for a new component Binary Compatibility ? GUID does not change, references from other components will work

3. Why iss it important to use source control software for source code?

Modification history.Code ownership: Multiple people can not modify the same code at the same time.

4. What two methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?

SetComplete and SetAbort.

5. What is the tool used to configure the port range and protocols for DCOM communications?


6. What does Option Explicit refer to?

All variables must be declared before use. Their type is not required.

7. What are the different ways to Declare and Instantiate an object in Visual Basic 6?

Dim obj as OBJ.CLASS with eitherSet obj = New OBJ.CLASS orSet obj = CreateObject(OBJ.CLASS?) orSet obj = GetObject( , OBJ.CLASS?)orDim obj as New OBJ.CLASS

8. Name the four different cursor types in ADO and describe them briefly.

The cursor types are listed from least to most resource intensive.Forward Only Fastest, can only move forward in recordset Static Can move to any record in the recordset. Data is static and never changes.KeySet Changes are detectable, records that are deleted by other users are unavailable, and records created by other users are not detectedDynamic ? All changes are visible.

9. Name the four different locking type in ADO and describe them briefly.

LockPessimistic Locks the row once after any edits occur.LockOptimistic Locks the row only when Update is called.LockBatchOptimistic Allows Batch Updates.LockReadOnly Read only. Can not alter the data.

10. Describe Database Connection pooling (relative to MTS )?

This allows MTS to reuse database connections. Database connections are put to sleep as opposed to being created and destroyed and are activated upon request.

11. What are the ADO objects?

Provide a scenario using three of them to return data from a database. Expected answer: Connection Connects to a data source; contains the Errors collectionCommand Executes commands to the data source. Is the only object that can accept parameters for a stored procedure.Recordset The set of data returned from the database.Scenario: There are many possibilities. The most likely is as follows:Dim conn As ADODB.ConnectionDim rs As ADODB.RecordsetDim Cmd As ADODB.Commandconn.ConnectionString = ?CONNECTION STRING?conn.OpenSet Cmd.ActiveConnection = connCmd.CommandText = ?SQL STATEMENT?Set rs = Cmd.ExecuteSet rs.ActiveConnection = Nothingconn.Close

12. Under the ADO Command Object, what collection is responsible for input to stored procedures?

The Parameters collection.

13. What are some benefits of using MTS?

Database Pooling, Transactional operations, Deployment, Security, Remote Execution.

14. What is the benefit of wrapping database calls into MTS transactions?

If database calls are made within the context of a transaction, aborting the transaction will undo and changes that occur within that transaction. This removes the possibility of stranded, or partial data.

15. 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, exes are slower then dlls because communications between client and component must be marshalled across process boundaries. A single instance of an out of process component can service many clients.

16. What are the main components of the ADO object model? How are they used?

Connection: Used to make a connection between your app and an external data source, ie, sql server.Command: Used to build queries, including user-specific parameters, to access records from a data source (which are returned in a Recordset)Recordset:Used to access records returned from an SQL query. With a recordset, you can navigate returned records. You can also add, modify or delete records.

17. Can We create CGI scripts in VB??


18. Dim x, y as integer. What is x and y data type?

X as variant and y as integer.

19. What is Centralization Error Handling?

Writing function and calling it when error occurs.

20. What is frx?

When some controls like grid and third party control placed in our application then it will create frx in run time.

21. What is the Dll required for running the VB?


22. Why we use Treeview Control?

To list the hierarchical list of the node objects. Such of files and Directories.

23. Handling Error in Calling chain.

This will call the top most error where the error is handled.

24. In project properties if we set Unattended what is it mean?

This cannot have user interface. This can be used for the COM creation.

25. 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.

26. What is view Port?

The area under which the container provides the view of the ActiveX Document is known as a view port.

27. What are the different types of error?

Syntax Errors, Runtime , Logic.

28. What is the diff between the Std and Class Module?

Std Global with in the project. Cls Global through out the all project only thing is we want to set the type lib. Class Modules can be Instantiated.

29. What is Mixed Cursors?

Static + Keyset

30. Drag and Drop state numbers and functions?

State 0 Source control is being dragged with the range of a target.
1 Out of the range of a target.
2 One position in the target to another.

31. What are the Style Properties of Combo Box?

Simple, Dropdown list We can type and select. Dropdown Combo Only Drop Down.

32. What are the Style properties of List Box?

Simple Single Select , Extended. Multiple Select.

33. What is Collection Objects?

Similarly to arrays but is preferred over an array because of the following reasons.
1. A collection objects uses less Memory than an array.
2. It provides methods to add and delete members.
3. It does not required reason statement when objects are added or deleted.
4. It does not have boundary limitations.

34. What is the difference between Property Get, Set and Let?

Set Value is assigned to ActiveX Object from the form.
Let Value is retried to ActiveX Object from the form.
Get- Assigns the value of an expression to a variable or property.

35. How to change the Mouse Pointer?

Screen.MousePointer = VBHourGlass/VBNormal.

36. What is Friend Variable?

Scope sharable between projects.

37. What is DBFailError?

Rolls Back updates if any errors Occurs.

38. What are the record set types?

RdOpenFowardOnly 0 (Default used only for the read only purpose)
RdOpenStatic 1
RdOpenDynamic 2
RdOpenKeySet 3 (Normally used for the live project)

39. What is the diff between RDO and ADO?

RDO is Hierarchy model where as ADO is Object model. ADO can access data from both flat files as well as the data bases. I.e., It is encapsulation of DAO, RDO , OLE that is why we call it as OLE-DB Technology.

40. Diff types of Lock Types?

RdConcurReadOnly 0 (Default)
RdConcurLock 1 (Pessimistic Locking)
RdConcurRowver 2 (Optimistic Lociking)
RdConcurValues 3
RdConcurBatch 4

41. What are the scopes of the class?

Public, private, Friend

42. Have you create Properties and Methods for your own Controls?

Properties Public variable of a Class
Method Public procedure of a class

43. Private Dim x as integer. Valid ?

Private cannot be used in front of DIM.

44. Different type of Instantiation?

Private Only for the Specific Module.
Public not creatable Private & Public
Multi Use - Variable we have to declare.
Single Use Not possible through dll.
Global Multiuse Have variable not Required to Declare.
Global Single Use - Only for exe.

45. What are the different types of Dialog Box?

Predefined, Custom, User Defined.

46. What is Seek Method which type of record set is available this?

Only in DbOpenTables.
Syntax: rs.index = "empno" "=" , 10
If with our setting the rs.index then run time error will occur.

47. What is Zorder Method?

Object.Zorder = 1 or 0 Place a Specified mdiform form or control at the front or back of the z-order with n its Graphical Level.

48. Can us able to set Instancing properties like Singleuse, GlobalSingleuse to ActiveXDll?


49. What are properties available in Clip Board?

No Properties Available. Only the methods they are SetText, GetText, Setdata(), Getformat(), Clear.

50. What is the different between Microsoft ODBC Driver and Oracle OBDC Driver?

Microsoft ODBC driver will support all the methods and properties of Visual Basic. Where as the Oracle not.

51. What the RDO Methods and Events?

Methods Events
Begin Trans Validate
Commit Trans Reposition
Rollback Trans Error
Cancel Query Complied
Update Controls
Update row

52. What is MAPI ?

Messaging Application programming Interface.

53. What is MDI form?

MDI Styles?

54. What are the locks available in Visual Basic?

Locking is the process by which a DBMS restricts access to a row in a multi-user environment 4 types of locks. They are
1. Batch Optimistic
2. Optimistic
3. Pessimistic
4. ReadOnly
Operations in a relational database act on a complete set of rows. The set of rows returned by a SELECT statement consists of all the rows that satisfy the conditions in the WHERE clause of the statement. This complete set of rows returned by the statement is known as the result set.
Applications, especially those that are interactive and online, cannot always work effectively with the entire result set as a unit.
These applications need a mechanism to work with one row or a small block of rows at a time. Cursors are an extension to result sets that provide that mechanism.
Cursor or lock type Advantages Disadvantages AdOpenForwardOnly (Default) Low resource requirements Cannot scroll backward No data concurrency AdOpenStatic Scrollable (Wont detect changes made at the same time by another application) No data concurrency AdOpenKeyset Some data concurrency Scrollable Higher resource requirements Not available in disconnected scenario AdOpenDynamic High data concurrency Scrollable Highest resource requirements Not available in disconnected scenario AdLockReadOnly Low resource requirements Highly scalable Data not updatable through cursor AdLockBatchOptimistic Batch updates Allows disconnected scenarios Other users able to access data Data can be changed by multiple users at once AdLockPessimistic Data cannot be changed by other users while locked Prevents other users from accessing data while locked AdLockOptimistic Other users able to access data Data can be changed by multiple users at once

55. Diff type of Datatypes?

LOB (Large Object Data type).
CLOB (Stores Character Objects).
BLOB ( Store Binary Objects such as Graphic, Video Chips and Sound files).
BFILE(Store file pointers to LOB It may Contain filename for photos store on CD_ROM).

56. What is Tabstrip control?

Libraries of procedure external to the application but can be called from the application.

57. What is Static Variable?

Its Scope will be available through out the life time.

58. What is DBSqlPassThrough?

It will By Passing the Jet Query Processor.

59. What is the starting Index value? How to locate it?

It is tab control to place our controls with in the form in multiple sheets.
Index starts with 1.
And to identify If Tabstrip1.SelectedItem.
Index = 1 Then ..
End if

60. What is Parser Bug?

It is difficult to use database objects declared in a module from within a form.

61. What is keyword used to compare to objects?

ISOperator Returns Boolean.

62. Suppose from form1 to form2 object property settings will arise to ?

Invalid procedure call or argument (Run time error 5)

63. 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

64. What is Implicit?

Instance of specific copy of a class with its own settings for the properties defined in that class.
Note: The implicitly defined variable is never equal to nothing.

65. What is Inprocess and Out of Process?

Inprocess It will run with in the memory. ( Local Machine). Out of Process It will run out of the memory Normally in the server side.

66. Where will we give the option explicit keyword and for what?

In the general declarations section. To trap undeclared variables.

67. How can we call Stored procedure of Back End in RDO and ADO ?

In RDO We can call using RDO Query Objects.
In ADO We can call using Command Objects.

68. What is Static Cursor?

In ADO Snap Shot is called so.

69. How to check the condition in Msgbox?

If(Msgbox("Do you want to delete this Record",VbYesNo)=VbYes)Then End if

70. What is control array and how many we can have it with in the form?

Group of control share the same name. Max 32, 767.

71. What is diff between the Generic Variable and Specific Variable?

Generic Variable:
Create Object Ex:-Ole-Automation . No need refer the object library.
Specific Variable:
Binding Procedure Early and Late Binding ( Can be Remove from the Memory).

72. What is the diff. Between function and sub procedures?

Function will return value but a sub procedure wont return values

73. What is the max size allowed for Extension in Visual Basic?

Frm, bas, cls, res, vbx, ocx, frx, vbp, exe

74. What is FireHouse Cursors?

Forward Only Some time Updateable

75. With in the form we want to check all the text box control are typed or not? How?

For each currentcontrol in controls
if typeof currentcontrol is TextBox then
end if

76. What are the type of validation available in VB?

Field, Form

77. How to trap Data Base Error?

Dim x as RDOError

Setting the Cursors.
Default Cursor 0
ODBC Cursor (Client side) 1
ServerSide Cursors (More Network traffic) - 2

78. How to declare Dll Procedure?

Declare function "" lib ""
Alias "" (Arg, ..) as Return type.

79. Referential Integrity (Take care By jet database Engine). Cascade Delete, Cascade Update is done setting property of Attributes.?

DbRelationDeleteCascade, DbRelationUpdateCascade.

80. How to increase the Date corresponding with month,date,year?

Hour, min, sec, month, year, DateSerial, dateadd, datediff, weekday, datevalue, timeserial,timevalue.

81. Name some date function?

Dateadd(), Datediff(), Datepart(), Cdate()

82. What is difference between datagrid and flexgrid?

Datagrid Editable. Flexigrid Non-Editable. (Generally used for Read only purpose.)

83. What are two validate with Data Control?

Data_Validate, Data_Error.

84. To connect the Data Control with Back end What are all the properties to be set?

Data source Name, Record Source Name

85. What are the Technologies for Accessing Database from Visual Basic?set?

DAO, Data Control, RDO, ODBCDIRECT, ADO, ODBC API , 0040.

86. What is the diff between the Create Object and Get object?

Create Object - To create an instance of an object.
Get Object To get the reference to an existing object.

87. What is Mask Edit and why it is used?

Control. Restricted data input as well as formatted data output.

88. What is RdExecDirect?

Bypasses the Creation of a stored procedure to execute the query. Does not apply to Oracle.

89. Different type of Passing Value?

By value, By ref, Optional, Param Array. Note:- Optional keyword cannot be used while declaring arguments for a function using param array.

90. What are types of binding?

Assigning variable with defined memory space.
Late Binding - Memory size is allotted in later stage.
Ex:- Dim x as object
Early Binding - Memory size is allotted while declaring itself. New Key word is important.
Ex:- Dim x as New Object

91. What is Dataware Control?

Any control bound to Data Control.
Ex:- Textbox, Check Box, Picture Box, Image Control, Label, List box, Combo Box, DB Combo,

92. What is the default model of the form? And what is it number?

93. Why we need OLE-Automation? Advantages?

94. What methods are used for DBGrid in unbound mode?

AddData, EditData, Readdata, WriteData.

95. What is ADO? What are its objects ?

ActiveX Data Object. ADO can access data from both flat files as well as the databases. I.e., It is encapsulation of DAO, RDO, and OLE that is why we call it as OLE-DB Technology. Objects are Connection, Record Set, Command, Parameter, field, Error, Property.

96. What is the max size allowed for Max Text box length.


97. Record set types and Number available in VB?

1- Dynaset, 0 Table, 2 Snap Shot.

98. What is the max size allowed for Max Control Names length?


99. How many procedures are in VB?

function and sub procedures

100. What is the max size allowed for Max label caption length.?


101. what will be the result for 15/4 and 154 ?

15/4 = 3.75 and 154 = 3

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


103. Calling Stored Procedures in VB?

1. Calling Simply the Procedure with out Arguments "Call ProcedureName}"
2. If it is with Arguments Means then
Declare the Query Def qy
Set Qy as New Query def
Qy.SQL = "{Call ProcedureName(?

104. DSN Less Connection?

"Server=Oracle; Driver={Microsoft ODBC for Oracle};"

105. Visual Basic Interview Questions only

1. 3 main differences between flexgrid control and dbgrid control
2. ActiveX and Types of ActiveX Components in VB
3. Advantage of ActiveX Dll over Active Exe
4. Advantages of disconnected recordsets
5. Benefit of wrapping database calls into MTS transactions
6. Benefits of using MTS
7. Can database schema be changed with DAO, RDO or ADO?
8. Can you create a tabletype of recordset in Jet - connected ODBC database engine?
9. Constructors and distructors
10. Controls which do not have events
11. Default property of datacontrol
12. Define the scope of Public, Private, Friend procedures?
13. Describe Database Connection pooling relative to MTS
14. Describe: In of Process vs. Out of Process component. Which is faster?
15. Difference between a function and a subroutine, Dynaset and Snapshot,early and late binding, image and picture controls,Linked Object and Embedded Object,listbox and combo box,Listindex and Tab index,modal and moduless window, Object and Class,Query unload and unload in form, Declaration and Instantiation an object?
16. Draw and explain Sequence Modal of DAO
17. How can objects on different threads communicate with one another?
18. How can you force new objects to be created on new threads?
19. How does a DCOM component know where to instantiate itself?
20. How to register a component?
21. How to set a shortcut key for label?
22. Kind of components can be used as DCOM servers
23. Name of the control used to call a windows application
24. Name the four different cursor and locking types in ADO and describe them briefly
25. Need of zorder method, no of controls in form, Property used to add a menus at runtime, Property used to count number of items in a combobox,resize a label control according to your caption.
26. Return value of callback function, The need of tabindex property
27. Thread pool and management of threads within a thread pool
28. To set the command button for ESC, Which property needs to be changed?
29. Type Library and what is it's purpose?
30. Types of system controls, container objects, combo box
31. Under the ADO Command Object, what collection is responsible for input to stored procedures?
32. VB and Object Oriented Programming
33. What are the ADO objects? Explain them.
34. What are the different compatibility types when we create a COM component?
35. What do ByVal and ByRef mean and which is the default?
36. What does Option Explicit refer to?
37. What does the Implements statement do?
38. What is OLE and DDE? Explain.
39. What is the difference between Msgbox Statement and MsgboxQ function?
40. What keyword is associated with raising system level events in VB?
41. What methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?
42. What types of data access have you used.
43. What was introduced to Visual Basic to allow the use of Callback Functions?
44. Which controls can not be placed in MDI?
45. Which controls have refresh method, clear method
46. Which Property is used to compress a image in image control?
47. Which property of menu cannot be set at run time?
48. Which property of textbox cannot be changed at runtime and What's the maximum size of a textbox?
49. Which tool is used to configure the port range and protocols for DCOM communications?
50. What is Dll?
51. Question How many images can be placed in the image list?
52. What is the result of Null * Any value = 0 (Zero)?

Sources :
DEVFYI - Developer Resource - FYI

Click here to get Interview's Topic Index