Visual Basic Interview Questions And Answers

Visual Basic Interview Questions And Answers prepared from Codingcompiler experts. These Visual basic Interview Questions were asked in various interviews conducted by top multinational companies across the globe. We hope that these interview questions on visual basic will help you in cracking your next job interview. All the best and happy learning.

In this article, you’ll learn

  • Visual Basic Interview Questions
  • Visual Basic Interview Questions And Answers
  • Advanced Visual Basic Interview Questions And Answers
  • The Best Visual Basic Interview Questions And Answers


Visual Basic Interview Questions

  1. How Do You Register A Component?
  2. What Does Option Explicit Refer To?
  3. Name The Four Different Cursor Types In Ado And Describe Them Briefly
  4. Name The Four Different Locking Type In Ado And Describe Them Briefly.
  5. What Is Ole Used For ?
  6. What are the three main differences between flexgrid control and dbgrid(Data bound Grid) control?
  7.  What is difference between inprocess and out of process ?
  8. What are Benefits of wrapping database calls into MTS transactions?
  9. What is the difference between Image and Picture box controls?

Visual Basic Interview Questions And Answers


Q. How Do You Register A Component?

Answer : Compiling the component, running REGSVR32 MyDLL.dll

Q.  What Does Option Explicit Refer To?

Answer :

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

Q. Name The Four Different Cursor Types In Ado And Describe Them Briefly.

Answer :

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.

Q. Name The Four Different Locking Type In Ado And Describe Them Briefly.

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.

Q. What Is Ole Used For ?

Answer :

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.

Q. What are the three main differences between flexgrid control and dbgrid(Data bound Grid) control?

Ans. The Microsoft FlexGrid (MSFlexGrid) control displays and operates on tabular data. It allows complete flexibility to sort, merge, and format tables containing strings and pictures. When bound to a Data control, MSFlexGrid displays read-only data.Adaptation to existing Visual Basic code for the data-bound grid (DBGrid).

dbgrid is A spreadsheet-like bound control that displays a series of rows and columns representing records and fields from a Recordset object.

The data grids are bound controls; that is, they require a data source that actually connects to a database and retrieves their data. And it seems that the root of the problem with DBGrid is that there’s no data source that can be readily included along with the DBGrid control.

In Visual Basic, the solution is simply to include the Data Control on the same form as DBGrid. But the Data Control is an intrinsic control; it’s unavailable to anything outside of the Visual Basic environment itself. and VB 6.0 has a new set of data controls (DataGrid, DataList, DataCombo, MSHFlexGrid, MSFlexGrid) that once again are bound controls. Unlike DBGrid, though, they support OLE DB, and therefore rely on the an ADO Data Source (and in particular the ActiveX Data Objects Data Control, or ADO DC) for data access. Unlike the Data Control, the ADO.

DC is a custom control (that is, an .OCX) that can be added to any project. In short, if you add ADO DC to your project along with the DataGrid control.

Q. What is difference between inprocess and out of process ?

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

Q. What are Benefits of wrapping database calls into MTS transactions?

Ans. 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. Transaction that uses the Microsoft® Transaction Server (MTS) environment. MSMQ implicitly uses the current MTS transaction if one is available.

BENIFTIS OF USING MTS :

Database Pooling, Transactional operations, Deployment, Security, Remote Execution 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.

Q. What is the difference between Image and Picture box controls?

Ans. The sizing behavior of the image control differs from that of the picture box. It has a Stretch property while the picture box has an AutoSize property. Setting the AutoSize property to True causes a picture box to resize to the dimensions of the picture; setting it to False causes the picture to be cropped (only a portion of the picture is visible). When set to False (the default) , the Stretch property of the image control causes it to resize to the dimensions of the picture.

Setting the Stretch property to True causes the picture to resize to the size of the image control, which may cause the picture to appear distorted.

Q. What is the Default property of datacontrol ?

Ans. connect property.

Advanced Visual Basic Interview Questions And Answers

Q.  Define the scope of Public, Private, Friend procedures?

Ans. The set of public variables, methods, properties, and events described in a class module define the interface for an object. The interface consists of the object members that are available to a programmer who’s using the object from code.

You can create private variables, methods, properties, and events that are used by other procedures within the class module but are not part of the object’s public interface. Additionally, constants user-defined types, and Declare statements within a class module must always be private.

The Friend keyword makes a procedure private to the project: The procedure is available to any code running within the project, but it is not available to a referencing project.

Q. What is the Difference Query unload and unload in form?

Ans. Occurs before a form or application closes. When an MDIForm object closes, the QueryUnload event occurs first for the MDI form and then in all MDI child forms. If no form cancels the QueryUnload event, the Unload event occurs first in all other forms and then in an MDI form. When a child form or a Form object closes, the QueryUnload event in that form occurs before the form’s Unload event.

Q. What is a Type Library and what is it’s purpose ?

Ans. The type library may represent another Visual Basic project, or any other executable component that exposes a type library.

Visual Basic creates type library information for the classes you create, provides type libraries for the objects it includes, and lets you access the type libraries provided by other applications.

Q. What are the ADO objects?

Answer: 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.

Q. What is ADO? What are its objects ?

Answer: 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.

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

Answer:  DateSerial(year(Now),Month(Now)+1,1) Hour, min, sec, month, year, DateSerial, dateadd, datediff, weekday, datevalue, timeserial,timevalue.

Q.  Drag and Drop state numbers and functions?

Answer: 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.

Q. What is MAPI ?

Answer: Messaging Application programming Interface.

Q. What is Centralization Error Handling?

Answer: Writing function and calling it when error occurs.

Q. What is frx?

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

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

And: Vbrun300.dll

Q. Why we use Treeview Control?

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

Q. Handling Error in Calling chain.

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

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

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

The Best Visual Basic Interview Questions And Answers

Q. What is the size of the variant data type?

Answer: 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.

Q. Describe and In Process vs. Out of Process component. Which is faster?

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.

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

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.

Q. what is the difference between print() and println().

Answer: 

The difference between print() and println():-

1. print() in this method used to print valus provided inside the method”()”.
2. println() mehtod is used to print values provided inside the method “()” and moves cursor to the beginning of next line.

Q. What are the features you think are there in Kotlin but not in Java?

Answer: Kotlin has a lot of highlights that Java doesn’t.

1.Coroutines
2.Companion Objects
3.Data classes
4.Operator Overloading
5.Range expressions
6.Smart casts
7.Null Safety
8.Extension Functions

Note: There are many features but we write some of the best features

Q. Is there a Ternary Conditional Operator in Kotlin like in Java?

Answer:  

No, the ternary conditional operator in Kotlin is not like Java but is very different from it

Q. Explain Higher-Order Functions?

 Answer

Higher-Order Function is a function that takes functions as parameters or returns a function.

Q. How Can you execute Kotlin code without JVM?

 Answer: 

We can execute JVM, which stands for Java Virtual Machine is a feature of Kotlin. This feature compiles a Kotlin code into a native code, which can be done without JVM too.

OTHER INTERVIEW QUESTIONS

  1. Vagrant Interview Questions
  2. 60 Java Multiple Choice Questions
  3. 40 Core Java MCQ Questions
  4. Anaplan Interview Questions And Answers
  5. Tableau Multiple Choice Questions
  6. Python Coding Interview Questions
  7. CSS3 Interview Questions
  8. Linux Administrator Interview Questions
  9. SQL Interview Questions
  10. Hibernate Interview Questions
  11. Kubernetes Interview Questions
  12. Kibana Interview Questions
  13. Nagios Interview Questions
  14. Jenkins Interview Questions
  15. Chef Interview Questions
  16. Puppet Interview Questions
  17. RPA Interview Questions And Answers
  18. Android Interview Questions
  19. Mulesoft Interview Questions
  20. JSON Interview Questions
  21. PeopleSoft HRMS Interview Questions
  22. PeopleSoft Functional Interview Questions
  23. PeopleTools Interview Questions
  24. Peoplesoft Technical Interview Questions
  25. 199 Peoplesoft Interview Questions
  26. 200 Blue Prism Interview Questions
  27. Visualforce Interview Questions
  28. Salesforce Interview Questions
  29. 300 SSIS Interview Questions
  30. PHP Interview Questions And Answers

LEAVE A REPLY

Please enter your comment!
Please enter your name here