Do you know that? 30% Elance jobs are hourly next

Contact Email: teammmrem@yahoo.com

<< All Upwork (oDesk) and Elance Tests << Upwork (oDesk) test answers << Microsoft Technologies category

Test answers for Visual Basic Test 2016

(98 / 14) Last updated: March 25
Upwork (oDesk) • Microsoft Technologies
Questions and answers are regularly updated. Answered and not answered tests questions.

This helps getting job: Hundreds of (cover letter examples , interview questions , profile samples ) • Earn on Upwork (oDesk)
Job assistance: jobs popularityfreelance rates

Popular test answers: HTML, .Net, CSS, English, SEO, Photoshop, iOS, Java, Android, Ruby, Python, JavaScript

See all 6 tests answers updated

Find Upwork (oDesk) and Elance test answers on this website:



Collapse | Expand

98 Answered Test Questions:

1. Which of the following is the valid stepping option?

Answers:

• Step Around

• Step Beyond

• Step Over

• Step Behind

• Step forward

• Step Into

• Step Out

2. Which of the following procedure types will execute when you assign a value to a property of an object?

Answers:

• Property Get

• Property Assign

• Property Let

• Property Set

• Public Sub

3. Which line of code listed here can be used to create a string of fixed length:

Answers:

• Dim strFirstName as String

• strFirstName * 255

• strFirstName = 255

• Dim strFirstName as String(255)

• None of the above

4. Which event of an ActiveX control data provider runs every time a bound control extracts data through the provider?

Answers:

• GetDataMember

• GetDataField

• GetDataProperty

• GetDataRow

• GetData

• GetFields

• GetRows

• RetrieveData

5. Which property of the Err object returns the numeric value associated with the most recent runtime error?

Answers:

• Description

• No

• Number

• Source

• Errorcode

• Num

• Code

6. Which function or method will you use to get a count of the maximum index limit of an array?

Answers:

• UBound function

• LBound function

• Substr function

• Bound Control method

• Limit method

• UpperLimit method

• Upper method

• MaxArray function

7. Which is the only event of the timer control?

Answers:

• Timer

• TimeElapsed

• TimeOver

• Reset

• TimeOut

• Restart

• Freeze

• Stop

8. What you must do before you make calls to an ActiveX DLL project in the same Project Group?

Answers:

• Compile the DLL

• Check the DLL off in your project's Reference List

• Make sure the DLL is the Startup Project

• Ensure that a Standard Exe form is included and is made the Startup Form.

9. The _______ property changes the tab order at runtime:

Answers:

• Tab stop

• Tab key

• Tab order

• Tab index

10. Message Boxes can hold a maximum of _______ characters.

Answers:

• 256

• 512

• 1024

• 2046

• 4092

• 5000

• 10000

• No limit

11. Procedures declared in a _____ are local whereas procedures declared in a ______ are  available to the whole application.

Answers:

• Form window, standard or code module

• Project window, view code window

• Class module, code module

12. To store pictures in an array, Visual Basic provides the _____ control.

Answers:

• PictureClip

• ImageList

• PictureBox

• Image Box

• Timer Control

• ListView

• Common Dialog

• DataGrid

13. Which of the following situations would not cause the Initialize event of an ActiveX control to occur?

Answers:

• When a control is placed on a form at design time

• When a form designer containing a control is closed

• When a form is run

• When a compiled application containing a control executes

• When an application terminates and re-enters design-time for the host application

14. The settings for the Color properties in Visual Basic are indicated by:

Answers:

• Decimal Coding

• Octal Coding

• Hexadecimal Coding

• Binary Coding

15. You want to display the code and the description of an error. What would be the correct syntax?

Answers:

• Msgbox err.no & err.text

• Msgbox err.number & err.text

• Msgbox error.number & error.text

• Msgbox error.number & error.description

• Msgbox err.number & err.description

• Msgbox err.num & err.description

• Msgbox err.num & err.text

• None of the above

16. The Load & Activate events are associated with:

Answers:

• All controls

• Form

• Command button

• Image box

• TreeView control

• ListView control

• DataGrid

• ComboBox

17. How do you create a read only property in a form?

Answers:

• Create only a Property Set procedure

• Create only a Property Get procedure

• Create only a Property Let procedure

• Create both a Property Get and Property Let procedure

• Declare a public variable in the Declarations section of the form

• Declare a private variable in the Declarations section of the form

• Create both a Property Get and Property Set procedure

18. In Visual Basic, which method can you use to send key strokes to other Window applications?

Answers:

• AppActivate

• SendKeys

• Copying the contents from the ClipBoard & pasting

• Manually typing in the other application's Window

19. Which of the following will provide the best aggregate performance for a query that is not executed repeatedly?

Answers:

• Direct execution

• Stored procedures

• Prepared statements

• Data Environment

• ADO Data Control

20. Which of the following is an event of the Shape control?

Answers:

• GotFocus

• LostFocus

• Validate

• KeyPress

• A shape control does not have events

21. Labels do not respond to _____ and ______ events.

Answers:

• Got_Focus , Lost_Focus

• Click , DblClick

• Dragdrop , OLECompleteDrag

• Change, Link Error

22. The ____ function returns the numeric value from a string expression:

Answers:

• Val

• CStr

• Round

• Int

• Num

23. Which of the following tools can be used to change the value of a variable or property during break mode of an application?

Answers:

• Watch window

• Immediate window

• Callstack

• Locals window

• Debug object

24. What data type is the HelpContextID?

Answers:

• String

• Integer

• Single

• Double

• Long

• Char

• Float

25. The Kill command in Visual Basic is used for:

Answers:

• Stopping the current process

• Deleting files

• Terminating the application

• Stopping the current thread

• Debugging the application

• Error handling

• None of the above

26. A prepared statement is:

Answers:

• Query text cached on the client

• Query text cached on the server

• Compiled query cached on the client

• Compiled query cached on the server

• A stored procedure

• None of the above

27. Which of the following statements should you write to cause the component to fire an event?

Answers:

• RaiseEvent

• DeclareEvent

• FireEvent

• DoEvents

• ExecuteEvents

• Execute

• TriggerEvent

28. Which of the following locking types will lock a recordset only during an Update process and not immediately when the data modifications are requested?

Answers:

• Pessimistic

• Update

• Optimistic

• Batch optimistic

• Read only

• Delayed locking

29. What is the extension of the Visual Basic project file that stores the design of a user control.

Answers:

• .ctx

• .ctl

• .ctr

• .ocx

• .vbp

• .dll

• .ucl

• .utl

30. You are creating a client application that calls ActiveX DLLs. Which of the following properties of the Err object provides the name of a component that sends an error back to the client application?

Answers:

• Number

• Description

• CompName

• Component

• Source

• Text

• Desc

• None of the above

31. Consider the following program code:

(i)    Dim FileName as String
       Open FileName For Input As #FreeFile

(ii)   Dim FileName as String
       FileNum = FreeFile
       Open FileName For Input As #FileNum

Answers:

• Both (i) and (ii) are correct

• Only (i) is correct

• Only (ii) is correct

• (i) contains a logical error

• (ii) contains an error

• Both (i) and (ii) contain errors

32. Variables that allow sharing of values across event procedures are called:

Answers:

• Form level variable

• Object variable

• Module level variable

33. Which property of the form changes the form's title?

Answers:

• Name

• Heading

• Title

• Caption

• Logo

34. The event Lost_Focus of one object results in _____ of the other object:

Answers:

• Got_Focus

• Lost_Focus

• Mouse_click

• Refresh

• Validate

• Load

• Activate

• Initialize

35. How do you make a control gray and inaccessible in VB?

Answers:

• Set enabled to false

• Set disabled to true

• Color the control gray

• Hide the control

• Set the locked property to true

36. To destroy an object and free the memory space occupied by it, the keyword used is:

Answers:

• Delete

• Kill

• Nothing

• New

• Calloc

• Abandon

• Conserve

• Free

37. Which of the following methods is used to inform an ActiveX control's container that one of its properties has been modified?

Answers:

• PropertyChanged

• CanPropertyChange

• ModifyProperty

• PropertyModify

• PropertyChange

• PropertyModified

• PropertyChanges

• ChangeProperty

38. Which of the following is the only valid Resume statement in an error handler?

Answers:

• Resume prior

• Resume previous

• Resume later

• Resume next

• Resume before

• Resume to

• Resume statement

• Resume application

39. If the CancelError Property of the CommonDialog Box is set to true then which of the following statement is true:

Answers:

• A runtime error can result if the user clicks the cancel button

• A compile time error occurs

• The program executes without any error

• You need to carry out conditional compilation

• None of the above

40. In order to enable the DBGridControl or the MSFlexGrid Control to display the contents of a table or query, you need to set only the ______ property:

Answers:

• DataSource

• Connection

• RecordSource

• TableType

• RecordType

• DataType

41. One can convert a Visual Basic Application into ActiveX Document using:

Answers:

• Visual Database Manager

• Application Wizard

• ActiveX Document Migration Wizard

• Package and Deployment Wizard

42. Which event of a text box would you use for validating the data entered by the user?

Answers:

• Validate

• Validation

• Check

• Audit

• GotFocus

• Checkdata

• ValidateDate

43. Which events enable you to determine which key was pressed by the user?

Answers:

• Click and KeyPress

• Click, KeyUp and KeyDown

• KeyUp and KeyDown

• KeyPress, KeyUp and KeyDown

• Click, KeyPress, KeyUp and KeyDown

44. Which event occurs only once in the entire life cycle of an ActiveX control?

Answers:

• Initialize

• Resize

• Terminate

• WriteProperties

• InitProperties

• Activate

• None of the above

45. Only Controls with a ________ property such as Picturebox, Toolbox, Statusbar etc. can be placed on an MDI form:

Answers:

• Showtips

• Negotiate

• Align

• BorderStyle = 0

• Visible

• Locked

• Enabled

• Tag

46. The _______ function enables a VB application to make use of the idle time and to respond periodically to events.

Answers:

• GetTime()

• TrapEvents()

• GetDate()

• DoEvents

• Kill

• Idle

• Events

• Call

47. How many root nodes can a TreeView control have?

Answers:

• 1

• 2

• 3

• 4

• 5

• 10

• Upto 50

• No limit

48. In order to overlap the controls (say a command button) during design time, we use the 'Send To Back' or 'Bring To Front' option from the Edit menu. To change it dynamically (i.e. during program execution) we need to change:

Answers:

• Background color property

• Caption property

• ZOrder property

• AutoRedraw property

• SendtoBack property

• BringtoFront property

• Hide property

• Show property

49. What is the default value for the scalemode property of the form?

Answers:

• Twip

• Point

• Pixel

• Character

• Centimeter

• Inches

• Millimeters

50. Which of the following ADO recordset types provides the greatest degree of concurrency?

Answers:

• Static

• Forward-only

• Dynamic

• Keyset

• Read only

• Keyset and Dynamic

51. Which collection of an ActiveX control enumerates all of the properties that can be bound to a data source?

Answers:

• DataFields

• DataMembers

• DataBindings

• DataProperties

• DataBase

• DataColumns

52. Which object is used for error handling?

Answers:

• Error

• Err

• OnError

• App

• Application

• AppErr

• Exception

53. The _______ property enables Visual Basic to draw complete images in memory before displaying them on the Screen.

Answers:

• AutoRedraw = True

• AutoRedraw = False

• Refresh

• PaintPicture

54. Which event should be used to resize an ActiveX control as the user modifies the size of the control implementation on a form?

Answers:

• Resize

• Paint

• Repaint

• Initialize

• Change

• ReDimension

• Dimension

• Any of the above

55. Which event is fired when a text box loses focus?

Answers:

• LostFocus

• FocusLost

• RemoveFocus

• FocusAway

• NoFocus

• Leavefocus

• Validate

56. Which of the following approaches to data modifications is the least efficient?

Answers:

• Updating through a cursor using a recordset

• A stored procedure

• An update statement prepared and executed

• An update statement executed directly

• Updating through a data control

57. How can you keep the user from exiting a form by clicking the Close button?

Answers:

• Place code in the Terminate event

• Place code in the Unload event

• Place code in the QueryUnload event

• This can only be done by using the Windows API

• Place code in the Load event

• Place code in the Deactivate event

• None of the above

58. In order to provide a transparent background to the Form, you must change the _________  property to _______.

Answers:

• BackStyle, Opaque

• BackColor, White

• BackStyle, Transparent

• BackColor, Parent Window's Color

• ZOrder, 0

• BackColor, Transparent

59. What do CurrentX and CurrentY return?

Answers:

• Current X and Y co-ordinates of mousepointer

• Current X and Y co-ordinates of cursor

• A String of X & Y

• Current x and y co-ordinates of the control

60. Which property of the ProgressBar determines how much of the bar is filled?

Answers:

• Min

• Max

• Value

• CurrentVal

• FillValue

• Fill

• BarComplete

61. The _______ method loads the form named 'Form1' in to memory and also displays it.

Answers:

• Load Form1

• Form1.Show

• Form1.Visible = True

• Unload Form1

• Form1.activate

62. Which of the following cannot be included in the Open method of the recordset?

Answers:

• Cursor Type

• User Name

• Active Connection

• CursorLocation

• LockType

• Source

63. The caption and the name properties of the command button:

Answers:

• Are one and the same

• Can be different at times

• Are actually not properties

64. Which of the following statements forces inline error handling?

Answers:

• On Error GoTo linelabel

• On Error GoTo Inline

• On Error Stop

• On Error Resume Next

• On Error GoTo 0

• On Error Resume

• None of the above

65. Which of the following debug tools would you use to locate your current position in a series of embedded procedure calls?

Answers:

• Locals window

• Immediate window

• Watch window

• Callstack

• Debug object

66. Which of the following can be shown to the user using the Common Dialog control in VB?

Answers:

• Common messages passed to Windows

• Open dialog box

• Windows explorer

• Input box

• Message box

• Error messages

• Help

• None of the above

67. Consider the following subprogram:

        Sub ChangeText(ByVal X as String,Y as String)
          Y = X
        End Sub


If you are calling it using the following code:

            Call ChangeText(Form1.Caption,Y$)

Answers:

• The Caption of Form1 will change to the value contained in Y$

• The Caption of Form1 will not change

• The Caption changes at random intervals after the function call

• The code is incorrect

68. Visual Basic fires the _______ event everytime a part of the form         is newly exposed.

Answers:

• Load

• Activate

• Paint

• Show

• Initialize

69. What does the forms collection contain?

Answers:

• A list of all forms in a project

• A list of all hidden forms

• A list of all currently loaded forms

• A list of all visible forms

• All the child forms of an MDI application.

70. You try to initialize a new Object variable with the following line but receive an error. What could be the possible cause?

      Set MyVar = New Classname

Answers:

• You do not need to use the Set command here

• You do not have the permission to access the class

• MyVar has not been declared

• You do not need to use the New keyword here

• None of the above

71. What is the sequence of events when a form is unloaded?

Answers:

• QueryUnload, Unload and Terminate

• QueryUnload, Terminate and Unload

• QueryUnload and Unload

• Unload only

• Terminate, QueryUnload and Unload

• Terminate, Unload and QueryUnload

• Unload, QueryUnload and Terminate

• Unload, Terminate and QueryUnload

72. In order to change the mouse pointer shape from glass to watch-glass, the property to be used is:

Answers:

• MousePointer

• Picture

• Menu

• PointerStyle

• Pointer

• Cursor

• CursorStyle

• CursorShape

73. The _______ method resets the contents of bound controls to their original values when the user clicks on the cancel button.

Answers:

• UpdateControls

• PaintPicture

• Refresh

• Resize

• Resync

• Restore

• Cancel

• Update

74. Which of the following are not properties of Command Button:

Answers:

• Caption

• Visible

• Multi-Line

• Font

• Name

• Bold

• Tag

• Enabled

75. Which form event would you use to activate a pop-up menu when the user clicks the right mouse button?

Answers:

• Click

• MouseMove

• DragOver

• DragDrop

• MouseUp

• Mouse-popup

• PopupMenu

• ShowMenu

76. What does the controls collection contain?

Answers:

• A list of all controls on a form

• A list of all the controls used by your program

• A list of all text boxes on a form

• A list of all visible controls

• The names of all control arrays on the form

77. The interval property of the Timer control specifies the time in:

Answers:

• Milliseconds

• Seconds

• Minutes

• Hours

• Either milliseconds or seconds

78. Which of the following compiled elements does not run in process?

Answers:

• ActiveX EXE

• ActiveX DLL

• ActiveX Control

• MTS Component

• Standard DLL

• Standard Exe

79. Which method will you use to remove a form from the Screen but retain it in memory?

Answers:

• Show method

• Unload method

• Hide method

• CLS method

• Deactivate method

80. Global Procedures and Global Variables are declared in:

Answers:

• Form Modules

• Standard (Code) Modules

• Class Modules

• Resource files

• ActiveX Controls

• Data Environment

81. What is the sequence in which the following events are triggered when a form is loaded?

Answers:

• Initialize, Load, Resize and Paint

• Initialize, Load, Paint and Resize

• Load, Initialize, Resize and Paint

• Load, Initialize, Paint and Resize

• Initialize, Resize, Paint and Load

• Load, Paint,Initialize and Resize

• Initialize, Paint, Load and Resize

• Paint, Resize, Initialize and Load

82. An ADO dynamic property is:

Answers:

• A property that changes value at runtime

• A value defined by the user

• A value defined by the operating system

• A property that dynamically resizes as needed to accommodate database parameters

• A property implemented by the OLE DB service provider

83. Which event is triggered when the user moves to another open form?

Answers:

• Unload

• QueryUnload

• Deactivate

• Terminate

• Load

• Initialize

• Repaint

• Resize

84. Which event procedure is called only if AutoRedraw property is set to false:

Answers:

• Form_GotFocus

• Form_Paint

• Form_Activate

85. If one needs to use an ampersand(&) in a Label but does not want it to be an Access Key, the _______ property of the label must be set to False.

Answers:

• Caption

• ClipControls

• UseMnemonic

• LinkMode

• Locked

• Label

• ZOrder

• Visible

86. In order to access a file in Non-textual format, you have to open file in:

Answers:

• Ascii Format

• Binary Format

• Input Mode

• Output mode

• Append mode

• Read Mode

87. Which three methods does the collection object support?

Answers:

• Let, Get, Set

• Load, Unload, Count

• Add, Remove, Item

• Add, Delete, Index

• Add, Remove, Sort

• Add, Remove, Count

• Add, Delete, Count

• Add, Set, Count

88. The vbCritical symbol displays:

Answers:

• A warning query icon

• A critical message icon

• A warning message icon

• An exclamation icon

• None of the above

89. To save a file in a RichTextBox Control and a picture in a Picture Box Control, you will use the _________ and __________ statements, respectively:

Answers:

• RichText1.SaveFile, Picture1.SavePicture

• RichText1.LoadFile, Picture1.LoadPicture

• RichText1.SavePicture, Picture1.SaveFile

• RichText1.LoadPicture, Picture1.SaveFile

90. The ______ property is used to show Tool Tips or Help Balloons when the mouse rests on the object:

Answers:

• ToolTipText

• Tag

• Dragmode

• ShowTips

• Help

• Tip

• ShowHelp

• Tab

91. To deactivate the Form UnLoad event, you make the following change in the function definiton:

            Private Sub Query_Unload(Cancel as Integer,UnloadMode as Integer)

To prevent the Form from closing, you will set the:

Answers:

• Cancel parameter to a non-zero value

• Cancel parameter to 0

• UnloadMode parameter to a non-zero value

• UnloadMode parameter to a zero value

• UnloadMode parameter to 1

• Cancel parameter to 1

92. Which line of the following code contains an error?

1      public Sub Command1_Click()
2        Dim str As String
2        str = "Hello World"
3        i = val (str)
4        length = strlen(str)
5        Msgbox "No Of Characters in " & str & " = " & CSstr(length)
6      End Sub

Answers:

• Error on line 1

• Error on line 2

• Error on line 3

• Error on line 4

• Error on line 5

• Error on line 6

• No Error

93. Visual Basic displays information depending upon the current value of two properties of the form, called as:

Answers:

• CurrentX and CurrentY

• ScaleLeft and ScaleTop

• ScaleHeight and ScaleTop

• x and y

• TopX and TopY

• LeftX and LeftY

94. After a Dynaset type recordset has been created and opened, further searching is possible using the:

Answers:

• LookUp method

• Seek method

• Locate method

• FindNext method

• Search method

95. What is the purpose of the Class Builder add-in in Visual Basic:

Answers:

• To add classes to the current project

• To change the current project to a class based project

• To create new classes and define their properties, methods & events

• To draw out how the application model will look

96. Which events allow you to determine if a Control or Shift key was pressed by the user?

Answers:

• Click and KeyPress

• Click, KeyUp and KeyDown

• KeyUp and KeyDown

• KeyPress, KeyUp and KeyDown

• Click, KeyPress, KeyUp and KeyDown

• KeyPress and KeyUp

97. You can create menus by the ________ and _________.

Answers:

• Menu Editor, Application Wizard

• Menu Editor, Win32 API

• Win32 API, Application Wizard

• Class Builder, New Application Wizard

98. The ______ function can be used to run any .com, .exe, .bat or .pif file from a Visual Basic program.

Answers:

• Shell

• Substr

• SetAttr

• CStr

• Exec

• Perform

• Do

• None of the above


14 NOT Answered Yet Test Questions:

(hold on, will be updated soon)
99. Which of the following is the only drag related event?

Answers:

• DragEnter

• DragLeave

• DragStart

• DragStop

• DragDrop

• BeginDrag

• EndDrag

100. Which of the following statements is capable of abandoning a series of modifications made to a recordset locked with a BatchOptimistic lock?

Answers:

• CancelUpdate

• CancelBatch

• CancelBatchUpdate

• AbandonBatch

• AbandonBatchUpdate

• Rollbackupdate

• Rollbackbatch

• None of the above

101. Which parameter of the WriteProperty method can be omitted but should be included to increase the efficiency of the control?

Answers:

• Name

• Value

• Caption

• PropBag

• DefaultValue

• Title

• Tag

• None of the above

102. You are creating an ActiveX component that raises user-defined errors. Which of the following statements correctly raises an error to the client with error number 20000?

Answers:

• Err.Raise vbObjectError + 20000

• Err.Number = 20000

• Err.Raise 20000

• Err.Raise vbObjectError,20000

• Err.Number 20000

• Error.Raise vbObjectError + 20000

• Error.Number 20000

• Error.Raise 20000

103. You want the code of the close command button to execute upon pressing the ESC key, even though the focus may be on another control in the form. Which property of the command button would you set to true?

Answers:

• Cancel

• Escape

• Exit

• Focus

• Default

• Losefocus

• ExecEvent

• FireEvent

104. Which method of the Recordset object should you use to navigate multiple recordsets returned by a stored procedure?

Answers:

• NewRecordset

• NavigateRecordset

• OpenNextRecordset

• NextRecordset

• SkipRecordset

• PreviousRecordset

• JumpRecordset

• GoTORecordset

105. Which of the following will perform a direct execution of a Command object?

Answers:

• The Execute method

• The Prepare method

• The ExecDirect method

• The Open method

• The Exec method

• The ExecProcedure method

• None of the above

106. You are creating an ActiveX component that raises user-defined errors. What is the valid range of error numbers that you can use for user-defined errors?

Answers:

• 1-1000

• 0-255

• 1-65535

• 0-1000

• 513-65535

• 1000-2000

• 10000-20000

• None of the above

107. Which of the following is not an element of the ADO model?

Answers:

• Database

• Error

• Connection

• Parameter

• Recordset

• Field

• Driver

108. Which event should you use to store property values into the PropertyBag?

Answers:

• Terminate

• ReadProperties

• StoreProperties

• WriteProperties

• SaveProperties

• CommitProperties

109. What is the purpose of the Image List Control?

Answers:

• To display images to the user

• To help in creating a ToolBar

• To allow the editing of icons

• To provide a repository for images used by other controls

• To provide images to the listbox control

• To provide images for the splash screen

• To provide icons for error messages

110. Which of the following statements is incorrect regarding toolbars?

Answers:

• There can be only one toolbar on a form

• Toolbars can be positioned anywhere on the form

• Toolbars can be customized by the user

• Toolbar buttons can display images

• Toolbar buttons can display text

• Toolbars can have both images and buttons

111. A project group is a Project which:

Answers:

• Consists of several Programs

• Consists of several Applications

• Consists of Various Forms And Code Modules

• Consists of several Projects

112. Which method would you use to get a free or unused File identifier while opening any file:

Answers:

• FreeFile

• GetFileNum

• GetFile

• GetBytes

• NextFile

• File

• GetNextFile

• None of the above