devBistro logo
  • search jobs
  • search resumes
  • tech articles
  • tech interviews
  • job seekers
  • employers

VB Interview Questions

Visual Basic questions

  1. How do you register a component? Expected answer: Compiling the component, running REGSVR32 MyDLL.dll
  2. Name and explain the different compatibility types when creating a COM component. Expected answer: No Compatibility ? New GUID created, references from other components will not workProject Compatibility ? Default for a new component <Not as critical to mention this one>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? Expected answer: 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? Expected answer: SetComplete and SetAbort.
  5. What is the tool used to configure the port range and protocols for DCOM communications? Expected answer: DCOMCONFIG.EXE
  6. What does Option Explicit refer to? Expected answer: 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? Expected answer: 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. Expected answer: 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. Expected answer: 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 ) Expected answer: 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? Explain them. 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? Expected answer: The Parameters collection.
  13. What are some benefits of using MTS? Expected answer: Database Pooling, Transactional operations, Deployment, Security, Remote Execution.
  14. What is the benefit of wrapping database calls into MTS transactions? Expected answer: 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? Expected answer: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 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? Expected answer: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.

^Back to Top

VB 6, COM, DCOM, Microsoft platform interview questions

  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 ActiveX 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 destructors
  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 of an object?
  16. Draw and explain Sequence Model 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 do I register a component?
  21. How do I set a shortcut key for label?
  22. What 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. What are the ADO objects? Explain them.
  33. What are the different compatibility types when we create a COM component?
  34. What do ByVal and ByRef mean and which is the default?
  35. What does Option Explicit refer to?
  36. What does the Implements statement do?
  37. What is OLE and DDE? Explain.
  38. What is the difference between Msgbox Statement and MsgboxQ function?
  39. What keyword is associated with raising system level events in VB?
  40. What methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?
  41. What types of data access have you used.
  42. What was introduced to Visual Basic to allow the use of Callback Functions?
  43. Which controls can not be placed in MDI?
  44. Which controls have refresh method, clear method
  45. Which Property is used to compress a image in image control?
  46. Which property of menu cannot be set at run time?
  47. Which property of textbox cannot be changed at runtime?
  48. What is the maximum size of a textbox?
  49. Which tool is used to configure the port range and protocols for DCOM communications?

^Back to Top

Basic VB interview questions

A reader sent these in noting that these questions were used in his company for interviewing prospective VB programmers.

  1. How do you center a form?
  2. Can I send keystrokes to a DOS application?
  3. Convert an RGB value to a long, or a long to RGB.
  4. Implement smooth scrolling for either text, graphics or controls across a form.
  5. Implement some quick and easy encryption (can be something primitive).
  6. 4 different types of sorts: advantages and disadvantages.
  7. Compute CRC32 checksum, write a quick piece of code that accepts the packet of data and returns the CRC.
  8. How do you use the Mouse OFF event?
  9. How do I call Windows Help files from a VB program?
  10. How do I create a textbox that lets you insert tabs?
  11. How do I make text box that displays asterisks when the user types in data such as password?
  12. How do I create multi-column combo box?
  13. How do I make a menu popup from a CommandButton?
  14. How to create menus at run time in VB?
  15. Write a generic error handling routine.
  16. How to copy text to the Windows clipboard and from it.
  17. How can I call a Command button without clicking it?
  18. Write a simple app with Encrypt and Decrypt buttons and Textbox where the user can enter text for encryption and decryption.

Read more at TechInterviews.com


Looking for VB jobs?

  • Browse VB jobs »
  • Browse telecommute VB jobs »
  • Get VB jobs by email »

©2003-2009 Dev Bistro · About Us