OLE definition is that, OLE (pronounced as oh-leh) was originally mean as ‘object linking and embedding‘, it is a Microsoft compound document technology based on Component Object Model (COM), It is introduced into Microsoft Windows 3.1. ‘OLE (object linking and embedding)‘ gives all Windows applications a standard way to create compound documents that create objects within one microsoft application and embed them into other document. OLE object meaning is graphic,spreadsheet,msword, etc. that can be embedded into a document called the “container application.” If the object allowed to be edited, the application associated with it is called “server application“. [Read more…] about What is OLE (object linking and embedding)?
What is ActiveX Database Objects (ADO)?
A Microsoft OBJECT LIBRARY that provides extensible, object-oriented access to data held in a variety of formats. It is intended to supplant the firm’s earlier database access libraries DATA ACCESS OBJECTS and ROO, and is employed by both MICROSOFT TRANSACTION SERVER and INTERNET INFORMATION SERVER as their main means of retrieving data from both local and remote databases.
What is ActiveX?
A format developed by the Microsoft Corporation for implementing object-oriented software components. ActiveX controls are prefabricated components based on Microsoft’s COM object model, which can be employed to create new applications with little or no programming, for example by simply dragging-and-dropping them into a document, or by downloading them into a browser from a web site.
The VISUAL BASIC programming language works by dragging different ActiveX controls onto a blank container, and then writing a minimal amount of code to connect them together. There is a large market in such prefabricated controls, many written by vendors other than Microsoft, with spreadsheets, text editors, picture viewers, sound players and many other functions available ready to run.
What is alert box?
An alert box is a message that appears on the screen to warn you of some imminent disaster, or to inform you of a situation in which your actions may have irreversible consequences.
For example, if you’ve just chosen the command to delete a file, an alert box might warn you that the file will be gone forever, and ask you if you really want to delete it. You have to deal with the alert box before you can move on with your life, meaning your only option when you see something like this is to click one of the buttons it offers you. Typically the dark-bordered button (which is the default button) is the safest option available-and because it’s the default, you can hit the Return or Enter key instead of clicking the button. If the alert is telling you the computer crashed, then the button may not even work, in which case you just have to turn off your machine by its switch or, if you have one, press your reset switch
Explain Objects and Modules? What are the types of Modules in VB
Objects : Objects are the real world entities. People, companies, employees, fan and ledger entries are all types of objects. In object-oriented terms, the word object is used to describe one specific thing like a car. Objects have an identity and this identity is defined with properties. A car has its name, model, cost and color.
Objects also do things. E.g. the car accelerates, races etc. The things an object can do are called its behaviours.
Objects can be anything that exists in real world. They can be conceptual things, such as engineering process or payroll. These conceptual things are not tangible but are conceptual. The same object-oriented concepts apply regardless of whether the object is based on the real world, on a concept, or on the implementation.
Modules: Modules are collection of code and data that function something like objects in objects oriented programming, but without defining OOP characteristics like inheritance, polymorphism etc. The concept behind modules is to enclose procedures and data in a way that hides them from the rest of the program.
The two main types of procedures used in VB :
Event and General : In VB event procedures are invoked in response to keyboard, mouse or system action. Your code can also explicitly invoke event procedures. The maximum number of events a control can have is fixed. Event procedures are stored in a form module and are private by default. A general procedure is not executed unless explicitly invoked. You can create a general procedure either by choosing the procedure from the insert menu or by typing the procedure heading Sub followed by the procedure name on a blank line.
Event and general procedures are further classified as : Sub & Function.
What are the common properties of the Controls
The following properties apply to most of the objects :
• Name : It sets the name of the control, through which you can access the control’s properties and methods.
• Appearance : It can be 0 for a flat look or 1 for a 3-D look.
• Back Color : It sets the background color on which text is displayed or graphics are drawn.
• Fore Color : It sets the foreground color
• Font : It sets the face, attribute, and size of the font used for the text on the control.
• Caption : It sets the text that is displayed on many controls that don’t accept input, for example, the text on a Label control, the caption of a Command Button control.
• Text : It sets the text that is displayed on the controls that accept user input, for example, the TextBox control.
• Width & Height : These properties set the control’s dimensions.
• Left & Top : These properties set the coordinates of the control’s upper-left corner, expressed in the units of the container.
• Enabled : By default, this property’s value is True, which means that the control can get the focus.
• Visible : Set this property to False to make a control invisible.
Explain the elements of the User Interface
The user interface is what appears in the application’s window when it runs. It consists of various elements with which the user can interact and control the application. The first element of the user interface is the Form.
(i) Picture Box : This control is used to display images, and the images are set with Picture property
(ii) Label : This control displays text on a Form that the user can’t edit.
(iii) Text Box : It displays text that the user can edit.
(iv) Frame : It is used to draw boxes on the Form and to group other elements.
(v) Command Button : It is the most common element of the Windows interface. It represents an action that is carried out when the user clicks the button.
(vi) Check Box : It presents one or more choices that the user can select.
(vii) Option Button : Also called as radio buttons, appear in groups, and the user can choose only one of them.
(viii) Combo Box : It is similar to the List Box control, but it contains a text Edit field. The user can choose an item from the list or enter in the Edit field.
(ix) List Box : It contains a list of options from which the user can choose one or more. The user can scroll the list to locate an item.
(x) The Horizontal and Vertical Scroll Bars : The user specify a magnitude by scrolling the control’s button between its minimum and maximum value.
(xi) Timer : It is used to perform tasks at regular intervals.
(xii) File System Controls : These controls are used to add file-handling capabilities to your application
(xiii) Image : It is similar to the Picture Box control in that it can display images, but it supports only a few features of the Picture Box control and requires fewer resources.
(xiv) Data : It provides point and click access to data stored in data- bases.
(xv) OLE : It is a window you can place on your Form to host documents from other applications, such as Microsoft Word or Excel
What is an IDE
Visual Basic is not only a language. It’s an Integrated Development Environment in which you can develop, run, test and debug your applications.
The types of project that you can create in Visual Basic are as follows :
(i) Standard EXE : These are the typical applications that you develop with previous versions of Visual Basic.
(ii) ActiveX EXE, ActiveX DLL : These types of projects are available with the Professional edition. ActiveX components are OLE automation servers.
(iii) ActiveX Control : This type of project is also a feature of the Professional edition. We use it to develop your own ActiveX controls.
(iv) ActiveX Document EXE, ActiveX Document DLL : ActiveX documents are in essence Visual Basic applications that can run in the environment of the container that supports hyper-linking.
(v) VB Application Wizard, VB Wizard Manager : The Application Wizard takes you through the steps of setting up the skeleton of a new application. The Wizard Manager lets you build your own wizard.
(vi) Data Project : It’s identical to the Standard EXE project type, but it automatically adds the controls that are used in accessing databases to the Toolbox.
(vii) DHTML Application : VB6 allows you to build Dynamic HTML pages that can be displayed in the browser’s window on a client computer.
(viii) IIS Application : VB6 allows you to build applications that run on the Web server and interact with clients over the Internet with the Internet Information Server.
(ix) Addin : You can create your own add-ins for the VB IDE. These are special commands you can add to Visual Basic’s menus.
(x) VB Enterprise Edition Controls : It simply creates a new Standard EXE project and loads all the tools of the Enterprise Edition of Visual Basic.
What are objects and properties? How are they related to each other
Objects:
Think of objects as a thing, or a noun. Examples of objects are forms and controls. Forms are the windows and dialog boxes you place on the screen; controls are the elements that you place inside a form, such as text boxes, command buttons, and list boxes.
Properties:
Properties tell something about an object, such as name, color, size, location, or how it will behave. You can think of properties as adjectives that describes objects. When you refer to a property, you must first name the object, add a period, and then name the property. For example, refer to caption property of form called Form1 as Form1.Caption (say Form1.Caption).
What are the three steps for planning and creating Visual Basic project? Describe what happens in each step
To write a Visual Basic project you follow the three step process for creating the project and then repeat the project for creating the project. The three step involves setting up user interface, defining the properties, and creating code.
The Three-Step Process as follows:
Planning:
Design the user interface: When you plan the user interface, you draw a sketch of screens the user will see when running your project. On your sketch, show the forms and all the controls that you plan to see. Indicate the name that you planed to give the form and each of objects on the form.
Plan the properties: For each object, write down properties that you plan to set or change during the design of the form.
Plan the basic code: This step is where you plan procedures that will execute when your project runs. You will determine which events require action to be taken and then make a step-by-step plan for those actions
Programming:
After you have completed the planning steps and have agreement form your user, you are ready to begin the actual construction of the project. You will use the same three steps process that you used for planning.
Define the user interface: When you define the user interface, you create the forms and controls that you designed in planning stage.
Set the properties: When you set the properties of objects, you give each object name and define such attributes as the contents of the label, the size of text, and the words that appear on the top of command button and in the form’s title bar.
Write the Basic Code: You will use Basic programming statements to carry out the actions needed by your program. You will be surprised and pleased by how few statements you need to create powerful Windows program.
What is the purpose of Visual Basic file types: .vbp, .frm, .bas, and .ocx
Visual Project consist of at least two, and usually more, files as follows:
.vbp file: This file is called the project file, is a small text file that holds the names of the other files in the project, as well as some information about the VB environment.
.frm file: Each of your form in the project is saved in a file with extension. To begin your project your project will have only one form. Later you can expect your projects to have several forms, with one .frm file for each form. A from holds the description of all objects and their properties for each form, as well as the basic code that you have written to respond to the events. These are also referred as form modules.
.bas file: Optionally your project can have this file. These file holds basic statements that can be accessed from any form. As soon as you begin .bas file are called standard code modules.
.ocx file: additional controls, called custom controls, are stored with a file .ocx extension. If you include controls in your projects that are not part of the standard control set, the .ocx file names will be included in the project.
.vbw file: After you save a project, Visual Basic automatically adds one more file to your project with extension of .vbw. This file holds information about each project’s form.
When is Visual Basic in design time? Run time? Break time
Visual Basic has three distinct modes. While you are designing the user interface and writing code, you are in design time. When you are testing and running project, you are in run time. If you get an error or pause project execution, you are in break time.
What is purpose of name property of control
Every control has it’s properties one of the common properties of controls is name property. Name property is the one by which the control is identified and it is referred as the object name of that control.
By using name property programmer can access the other properties of the controls and methods as well at run time.
Visual Basic gives default name to the controls which can be later changed by changing it’s name property at the design time or urn time.
Which property determines what appears on the form for Label control
Caption property of the Label control determines what will appear on the Label control. This Caption property is changed at run time or design time. Use can not change the Caption property of the Label control.
What is the purpose of the Caption property of the Command button? And Caption property of the Form
Command button has a Caption property which is used to display a text on the top of Command Button.
Form object also has the Caption property. This property displays the Caption text at the title bar of the window.
This property can be changed run time or design time. But it cant be changed directly by the end user.
What does cmdPush_Click() mean? To what does cmbPush refer? To what does Click refer
Visual Basic is event driven programming language. Over here cmdPush_Click() is a event procedure, which belongs to cmdPush command button object.
Visual Basic automatically names your event procedures. The name consist of the object name, an underscore(_), and the name of event. For example: the click event of command button called cmdPush will be cmdPush_Click().
This procedure will be executed when ever Click event of the cmdPush command button is fired.
When you will click on the cmdPush command button at the run time the statements with in the cmdPush_Click() event procedure will be executed.
What is Visual Basic Event? Give Some Examples of Events
While your project is running, the user can do many things, such as move mouse around; click on either button; move, resize or close your form’s window; or jump to another application. Each action by the user causes an event to occur in your Visual Basic Project.
Some events you care about, and some events you don’t care about. If you write Basic code for particular event, then Visual Basic will respond to the event automatically execute your procedure. VB ignores events for which no procedures are written.
Visual Basic automatically names your event procedures. The name consist of the object name, an underscore(_), and the name of event. For example: the click event of command button called cmdPush will be cmdPush_Click().
What is compile error, time error, logical error,, when does it occur, and what might it cause it
Visual Basic convert your project to machine language, it finds any compile errors. You get compile errors when you break the syntax rules of Basic and sometimes when use an illegal object or property.
For example, try spelling End as end or using the world Quit instead of End. The compiler can only translate the seat spelling of the world and cannot recognize either of these words both cause the compile time error message box.
You also receive compile error if you accidentally use the wrong punctuation or place the punctuation in the wrong place. The compiler cannot understand lblMessage,Caption or lblMessage.Caption;
The editor might find compile errors as you move of offending line. Or the compile error may not be found until you try to run the project. Before Visual Basic can actually run your project, it attempts compile the code into machine language. If VB finds compile errors, it displays Code window, highlights the offending line, and enters break time. After you have corrected your compile errors, you can click on run button to continue the compilation and running project.
If your project halts during execution, that’s a run-time error. Visual Basic displays a dialog box, goes into break time, and highlights the statement causing.
The statement that cannot be executed correctly cause run-time errors. The statements are correctly formed Basic statement fail to execute.
Run time error can be caused by attempting to do impossible arithmetic operation such as calculate with non-numeric data, divide by zero, or find the square root of negative number.
With logical errors your projects runs but produces incorrect results. Perhaps the result of a calculation are incorrect or the wrong text is OK but appears in wrong location.
If the project runs, it must be right-right? All too often, that statement is not correct. You may need to use calculator to check the output. Check all aspects of the project.
For example, the you want to print hello world but you are giving some incorrect message at the wrong place it will not give out put as you expected and it causes the logical error to solve these kinds of errors you must check the code carefully.
What is a tooltip ? How can you make it to appear
If you are a windows use,you probably appreciate and rely on ToolTips,those small labels that pop up when you pause your pointer over a toolbar button or control.You can easily add ToolTips to your projects by setting the ToolTip Text property of any control that you want to display a ToolTip.
To define a ToolTip for a command button, add a new command button to a form .Change the button’s Caption property to Exit and set its ToolTipText Property to “Close and Exit the program “.Now run the project , point to the Exit button , and pause ; the ToolTip will appear.