Popular Posts

Wednesday 7 March 2012

Interview Question - Visual Basic 6

Visual Basic 6
Interview questions and answers for Visual basic 6 basics and advance level,VB6  Interview questions and answers including vb6 syntax, datatype, functions, events, classes, objects, com, dcom, activex control. Windows API interview question and answers for vb6.
VB 6 interview questions includes, using controls, activex, object oriented programming (OOP) concept, in-process and out-process server, creating and using dlls, user controls, data access technology like Data Access Object (DAO), Activex Data Object (ADO), Setup and deployment, registering component, using data reports, Windows application programming interface (WIN API).

 

































 
1. How do you register a component?
  Compiling the component, running REGSVR32 MyDLL.dll
 
2. What does Option Explicit refer to?
  All variables must be declared before use. Their type is not required.
 
3. What are the different ways to Declare and Instantiate an object in Visual Basic 6?
  Dim obj as OBJ.CLASS
Set obj = New OBJ.CLASS
or
Set obj = CreateObject (“OBJ.CLASS”)
 
4. Name the four different cursor types in ADO and describe them briefly.
  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 detected
Dynamic: All changes are visible.
 
5. 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.
 
6. What are the ADO objects? Explain them. Provide a scenario using three of them to return data from a database.
  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
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.
 
7. List out controls which does not have events
  shape, line controls
 
8. To set the command button for ESC, which Property has to be changed ?
  Cancel
 
9. What is OLE Used for ?

Object linking and embedding, for using to other object classes like word, excel , autocad objects in our own applications, only thing we have to add reference for these objects
 
10 Which controls have refresh method?

Checkbox, comna, combo, list, picture, ADo control, Data,Datagrid, Datareport,Dir list biox, filelistbox etc
 
11. Early Binding vs Late Binding - define them and explain?

Early binding allows developers to interact with the object’s properties and methods during coding permits the compiler to check your code. Errors are caught at compile time. Early binding also results in faster code
Eg : Dim ex as new Excel.Application

Late binding on the other hand permits defining generic objects which may be bound to different objectsyou could declare myControl as Control without knowing which control you will encounter. You could then query the Controls collection and determine which control you are working on using the TypeOf method and branch to the section of your code that provides for that type

Eg : Dim ex as Object
set ex =CreateObject(“Excel.Application”)
 
12. Can I send keystrokes to a DOS application?

AppActivate (”C:\windows\system32\cmd.exe”) ‘ Appilcation caption
SendKeys (”SA”) ’For sending one string
SendKeys “% ep”, 1 ’ For sending Clipboard data to Dos
 
13. How do I make a menu popup from a CommandButton

Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
   If Button = 2 Then
       PopupMenu Menuname
   End If
End Sub
 
14. What is Option Base used for in VB6 ?

Option Base is to set the Index of the Array to start from 0 or 1.Like option explicit.. declare “Option base 1″ at the top. now the array will start from Index By default the index starts from 0.
 
15. How to copy text to the Windows clipboard and from it.

Clipboard.SetData
and
Clipboard.GetData
 
16. which method of recordset is used to store records in an array.

getrows
 
17. What is the default property of datacontrol.

Caption
 
18 Which property of textbox cannot be changed at runtime

Ans : LAignment property, tabindex etc
 
19. Describe In Process and Out of Process component?

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
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 marshalled across process boundaries
 
20. Under the ADO Command Object, what collection is responsible for input to stored procedures?

The Parameters collection.
 





 Next  ASP

No comments:

Post a Comment