Visual Basic Interview Questions and Answers
Visual Basic Interview Questions and Answers
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
Modification history.Code ownership: Multiple people can not modify the same code
at the same time.
What two methods are called from the ObjectContext object to inform MTS that the
transaction was successful or unsuccessful?
What is the tool used to configure the port range and protocols for DCOM
communications?
DCOMCONFIG.EXE
All variables must be declared before use. Their type is not required.
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
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.
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.
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.
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
Under the ADO Command Object, what collection is responsible for input to stored
procedures?
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.
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.
Yes.
Dim x, y as integer. What is x and y data type?
What is frx?
When some controls like grid and third party control placed in our application then it
will create frx in run time.
Vbrun300.dll
To list the hierarchical list of the node objects. Such of files and Directories.
This will call the top most error where the error is handled.
This cannot have user interface. This can be used for the COM creation.
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.
The area under which the container provides the view of the ActiveX Document is
known as a view port.
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.
Static + Keyset
Simple, Dropdown list We can type and select. Dropdown Combo Only Drop Down.
3. It does not required reason statement when objects are added or deleted.
Screen.MousePointer = VBHourGlass/VBNormal.
What is DBFailError?
RdOpenStatic 1
RdOpenDynamic 2
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.
RdConcurReadOnly 0 (Default)
RdConcurValues 3
RdConcurBatch 4
Have you create Properties and Methods for your own Controls?
Only in DbOpenTables.
rs.seek "=" , 10
If with our setting the rs.index then run time error will occur.
No.
No Properties Available. Only the methods they are SetText, GetText, Setdata(),
Getformat(), Clear.
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.
What the RDO Methods and Events?
Methods Events
Refresh
Update Controls
Update row
What is MAPI ?
MDI Styles
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.
BLOB ( Store Binary Objects such as Graphic, Video Chips and Sound files).
BFILE(Store file pointers to LOB It may Contain filename for photo’s store on
CD_ROM).
Libraries of procedure external to the application but can be called from the
application.
It is tab control to place our controls with in the form in multiple sheets.
Index = 1 Then ..
End if
1 Textual Comparing
What is Implicit?
Instance of specific copy of a class with its own settings for the properties defined in
that class.
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.
Where will we give the option explicit keyword and for what?
How can we call Stored procedure of Back End in RDO and ADO ?
What is control array and how many we can have it with in the form?
Generic Variable:
Specific Variable:
Binding Procedure Early and Late Binding ( Can be Remove from the Memory).
Function will return value but a sub procedure wont return values
With in the form we want to check all the text box control are typed or not? How?
end if
next
Field, Form
Dim x as RDOError
X(0).Des
X(1).Number
Default Cursor 0
Referential Integrity (Take care By jet database Engine). Cascade Delete, Cascade
Update is done setting property of Attributes.?
DbRelationDeleteCascade, DbRelationUpdateCascade.
DateSerial(year(Now),Month(Now)+1,1)
Hour, min, sec, month, year, DateSerial, dateadd, datediff, weekday, datevalue,
timeserial,timevalue.
Datagrid Editable. Flexigrid Non-Editable. (Generally used for Read only purpose.)
What are two validate with Data Control?
Data_Validate, Data_Error.
To connect the Data Control with Back end What are all the properties to be set?
What are the Technologies for Accessing Database from Visual Basic?set?
What is the diff between the Create Object and Get object?
What is RdExecDirect?
Bypasses the Creation of a stored procedure to execute the query. Does not apply
to Oracle.
By value, By ref, Optional, Param Array. Note:- Optional keyword cannot be used
while declaring arguments for a function using param array.
Early Binding - Memory size is allotted while declaring itself. New Key word is
important.
Ex:- Textbox, Check Box, Picture Box, Image Control, Label, List box, Combo Box,
DB Combo,
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.
What is the max size allowed for Max Text box length.
32,000
3.
255.
2.
What is the max size allowed for Max label caption length.?
2,048
What is the max size allowed for Msgbox Prompt and Input Box?
1024