Question Bank for VB

Embed Size (px)

Citation preview

  • 7/27/2019 Question Bank for VB

    1/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 1 of 1

    Multiple Choice Questions

    1. How many versions of Visual Basic are there?1. 12. 33. 24. 4

    2. Which version of Visual Basic comes with Visual SourceSafe?1. Standard version2. Learning version3. Enterprise version4. Professional version

    3. Will Visual Basic 6.0 run under Windows 3.1?1. No.

    2. Yes

    4. What IDE window gives you an overview of the files in your project?1. Project View2. Project Explorer3. Code window4. Properties Window

    5. The Components item is in which menu?1. Project2. Tools3. Edit4. Run

    6. How can a form be displayed in the maximized state as its displayed on screen?1. By adding the statement me. Show (VB. Maximized) in the form Load event.2. By setting the Window State property of the form to VB Maximized.3. BY altering the Form state in the project properties dialog box.4. By adding the code statement Me. Maximized in the Resize event of the form.

    7. Who owns Visual Basic?1. Borland2. Sun Microsystems3. Microsoft4. Apple

    8. Who is your #1 source for Visual Basic tutorials and information?1. Somebody I know2. The Visual Basic Almanac3. Good Question4. I don't know

    9. .lpk is the extension for what kind of file?1. Workspace files2. License files3. Intermediate list files4. Link files

  • 7/27/2019 Question Bank for VB

    2/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 2 of 2

    10.a) Its possible to create an object of a standard module as well as that of a class

    module.

    b) An object of the class module need not be initialized while the object of the standardmodule needs to be explicitly initialized.

    1. Only a is True..2. Both a and b are True.3. Both a and b are False.4. Only b is True.

    11. Where do you set the version of a project?1. Version tab of the Project Properties dialog2. General tab of the Project Properties dialog3. Make tab of the Project Properties dialog4. Build tab of the Project Properties dialog

    12. If Visual Basic doesn't offer you the option of bringing up the Visual ComponentManager, how can you make it available?1. Use the Extension item in the Insert menu.2. Use the Add-In manager to add the Visual Component Manager.3. Select the Visual Component Manager item in the Project Menu.4. Reinstall Visual Basic.

    1. Fundamentals13. What const you need to pass to msgBox to make it System Modal Dialog.

    1. VB App Modal2. VB Sys Modal3. VB System Modal

    4. VB Windows Modal

    14. Which of these keywords may not be used to declare a variable?1. Dim2. Class3. Private4. Public

    15. Which of these is not a legal way to name a variable?1. Using underscore (_) in the name2. Starting the name with a letter3. Making the variable name more than 127 characters long4. Starting the name with a number

    16. Which statement would you use to force declaration of all variables in a module?1. Option Base2. Option Explicit3. Option Private4. Option Declare

    17. This statement: Public intArray(900) As Integer, declares an array with how manyelements?1. 9002. 18003. 8994. 901

  • 7/27/2019 Question Bank for VB

    3/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 3 of 3

    18. Which of the following is not an intrinsic Visual Basic data format?1. Currency

    2. Date3. Object4. Float

    19. Variables declared at the module level in the modules (General) section using Public areavailable:1. Throughout the project2. In Public subroutines in the module only3. Throughout the module but not the project4. Throughout the project and the project group

    20. Which of these is not a valid setting for the Flags property of the Common Dialogscontrol when you use the ShowFont method?1. cdlCFBoth2. cdlCFPrinterFonts3. cdlCFInstalledFonts4. cdlCFScreenFonts

    21. The number of milliseconds between timer ticks is held in what property?1. Milliseconds2. Time3. Period4. Interval

    22. Is this legal: /* This is a /* nested */ comment */1. Yes2. No

    3. Cant say4. Both 1 & 2

    23. printf("%%d prints Integers");1. Prints "%d prints Integers"2. Prints "%%d prints Integers"3. Prints "0 prints Integers"4. Poduces a syntax error

    24. x = ++y;1. If y = 10, x will be assigned 10 and y will become 112. If y = 10, x will be assigned 9 and y will become 93. If y = 10, x will be assigned 11 and y will become 11

    4. If y = 10, x will be assigned 11 and y will remain at 10

    25. int square(int x);1. The square function returns nothing2. The square function returns an integer3. The square function returns x4. None of the above

    26. x = strlen("Juicy");1. x would equal 52. x would equal 63. x would equal 04. Would produce a syntax error

  • 7/27/2019 Question Bank for VB

    4/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 4 of 4

    27. What is the function, "malloc", used for1. Allocate memory

    2. Locate malformed statements3. Locate the maths library4. To shop occasionally

    28. Why is the "dot notation" used with structures1. To declare the structure2. To access the structure members3. To access the structure members if the structure is a pointer4. None of the above

    29. What of the following best describes a linked list1. A function that calls itself2. A multi-dimensional array3. A self-referential data structure

    4. A valid open file

    30. which of the following could be used to write to a file1. fprint2. fprintf

    3. printff4. printfile

    31. txtcopy first.txt second.txt1. argv[1) would return, "txtcopy"2. argv[1) would return, "first.txt"3. argv[1] would return, "second.txt"4. None of the above

    32. .How would you create an interface?1. Public methods with empty body2. Private methods with empty body3. Public methods and data members.4. Public data members.

    33. What is the sequence of events when form is unloaded?1. Unload, Query Unload and terminate2. Query Unload, Unload and terminate3. Unload only4. Query Unload and Unload.

    34. How do you create a read only property in a class?1. Create only a property let procedure2. Create only a property get procedure3. Create both property let and get procedures.4. Declare a public variable in the declaration section.

    35. What command triggers an event created in a class?1. Raise event2. Set event3. Trigger4. Fire Event

    36. Which of the following function declaration is valid?

  • 7/27/2019 Question Bank for VB

    5/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 5 of 5

    1. Declare Private function Get Value (name: =String): =Integer2. Function Get Value (name as String) as Integer3. Declare Public Get Value (name as String) as Function

    4. Declare Get Value (name as String) as Function

    37. When declaring a variable, what do you begin the statement with?1. Dec2. Declare3. Dim4. Int

    38. What does an If statement do?1. Compares two conditions2. Produces an sytax error3. Can only compare strings and integers4. Used as a boolean operator

    39. The For statement signifies that what statement will eventually follow?1. Loop2. Next3. Goto4. Back

    40. Which of the following statements will exit your program?1. Exit2. End3. Stop4. Shell

    41. Can two Strings, whose characters are numbers, do mathematical operations?1. Yes2. No3. May be4. Depends on the condition

    42. In the following code segment, what would use the value of x in the MsgBox?Dim X as IntegerPrivate Sub Display Value ()

    X=10Call Alter Value (X)MsgBox Value of X= &X

    End Sub

    1. An error message will be generated2. 1003. 104. 1

    43. __________ Function returns the current date and time in VB,.1. Format Date Time ()2. Now ()3. Date Time ()4. None of the above.

    44. Observe the following code snippet

  • 7/27/2019 Question Bank for VB

    6/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 6 of 6

    Private Sub Code ExampleDim X as IntegerX=100

    X=sqrt(X)If X 100 Then MsgBox XEnd Sub

    On Execution of the above code, what will happen?

    1. 10,0002. 103. Compile error4. No output

    45. What will be the output of the following code?Dim Indy As IntegerFor Indy =1 To 10 step1

    Debug. Print IndyIndy=Indy+2

    Next Indy1. Immediate window will display 1,4,7,10.2. Immediate Window will display 1,2,3,4,5,6,7,8,9,10.3. Immediate Window will display 1,3,5,7,9.4. Immediate Window will display 1,3,4,6,7,9,10.

    46. Which is not valid loop construct?1. For k=100 to 10 step5

    MsgBox k*kNext k

    2. For k=100 to 10 step 5MsgBox k*k

    Next3. Select case k

    case 10:MsgBox k*kcase Else :

    End Select4. For I=1 to 100 Next I

    47. Msg Box 23+7 will return?

    1. 302. 2373. 23+7

    4. Compilation Error

    48. What is the return type of the Msg Box Function?1. Int2. String3. Object4. MsgBox( ) doesnt support any value

    49. If a procedure name Calculate requires 2 parameters that cannot be internally changedand return the result as a long value, what should be the probable declaration.

    1. Sub Calculate (int X as Integer, int Y as Integer) as Long2. Function Calculate (By Val Dim X As Integer, By Val Int Y As Integer) as Long

  • 7/27/2019 Question Bank for VB

    7/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 7 of 7

    3. Function Calculate (Int x As Integer, Int Y As Integer) as Long4. None of the above.

    50. Private Sub My Sub () as IntegerStatic Count as IntegerIf Count>=4 then

    Exit SubElse

    My SubEnd If

    End SubWhat will be the output of MySub

    1. Compile Error2. Out Of Stack Error3. 44. 0

    51. Which data type is most suitable for storing an Age1. Single2. Double3. String4. Variant

    52. End For can be used to leave a For/Next Loop early1. True2. False

    53. Which of the following is the correct syntax to count backwards1. For counter = 10 Down To 1

    2. For counter = 10 To 1 Step -13. For counter = 10 To 1 Step Down4. For counter = 1 To 10 Step Down

    54. Left("Juicy Studio", 3)1. Returns "Ju"2. Returns "Jui"3. Returns "Juic"4. Returns "Juicy"

    55. What is the result of setting the DragMode for a control to Automatic1. The MouseDown, MouseMove and MouseUp Event are disabled2. The MouseDown, MouseUp and Click Event are disabled

    3. The GotFocus Event is disabled4. The control is able to move without any user intervention

    56. What keyword is placed before a parameter to a function, to ensure it is read-only1. ByValue2. ByReference3. ByVal4. ByRef

    57. Which event s used to store persistent data for controls property.1. Write Data2. Write Property3. Read Property

  • 7/27/2019 Question Bank for VB

    8/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 8 of 8

    4. Read Saved Data

    58. In the VB development environment____________ shortcut key is used to open the

    properties window?1. F52. Ctrl + P3. Alt + P4. F4

    2. Working with Forms59. Which of the following is not an issue of code maintainability?

    1. Be modular2. Use comments3. Use consistent variable names

    4. Select Compiler Options carefully

    60. How many MDI forms can a project have1. 02. 13. 24. 3

    61. State which of the following statements is TRUE1. Loading a form will not display the form on the screen.2. Query Unload event of a form occurs after the unload event of the form.3. Hide method of the form will remove the Form object from the memory.4. Unload event is a parameter-less event.

    62. The Activate event fires only when the focus shifts___________1. From one form to other in same application.2. From one form to other in different Application.3. When form is loaded4. When form is resized.

    63. .Which of the following events will be fired first when a form is loaded first?1. Initialize event2. Paint event3. Resize event4. Load event

    64. What object holds the currently active form?1. The Screen objects ActiveForm object

    2. The App objects Form object3. The App objects ActiveForm object4. The Screen objects Form object

    65. When a form loads, what events happen in what order?1. Load, Initialize, GotFocus2. Initialize, Load, GotFocus3. Activate, Initialize, Load

    4. Load, Activate, GotFocus

    66. When a form is unloaded, what events happen in what order?1. QueryUnload, Unload, Terminate

  • 7/27/2019 Question Bank for VB

    9/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 9 of 9

    2. Deactivate, Unload, Terminate3. Unload, Deactivate, Terminate4. QueryUnload, Terminate, Unload

    67. Among the following, which is the valid method for making an EXE file of your VBapplication1. From the command prompt, execute the command make EXE2. From the file menu options, select make EXE

    3. By running the application once.4. By pressing F10.

    68. Whch statement creates an instance of Form1at runtime.1. Form1.load2. Dim frmRun as Form13. Set frmRun=Create Form 14. Set frmRun=New Form 1

    69. Which form property holds the forms Windows handle?1. hWnd2. Handle3. hWindowHandle

    4. hWindow

    70. What property lets you set a forms original screen position?1. OriginalPosition2. StartPosition3. Position4. StartupPosition

    71. Which of the following is not a valid value for the UnloadMode argument of theQueryUnload event handler?1. vbFormControlMenu2. vbAppWindows3. vbFormCode

    4. vbFormUnload

    72. What argument(s) is/are passed to the KeyUp and KeyDown event handlers?1. KeyCode2. KeyAscii3. KeyAscii, Shift4. KeyCode, Shift

    3. Menu73. The Parent property of a menu object holds which of these items?

    1. The Screen object2. The menu bar object3. The App object4. The forms hWnd value

    74. Menu Item fires a click event when1. User clicks on it.

    2. User presses shortcut keys.3. User presses hot keys.4. Never

  • 7/27/2019 Question Bank for VB

    10/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 10 of 10

    75. What property specifies whether or not top-level Menu controls are displayed on themenu bar while a linked object or embedded object on a form is active?1. NegotiateMenus

    2. NegotiateMenuBar3. NegotiatePosition4. Negotiate

    76. Which of these is not a way to start the menu editor?1. Select the Menu Editor item in the Edit menu.2. Select the Menu Editor item in the Tools menu.3. Press the shortcut Ctrl+E.4. Click the Menu Editor button in the tool bar.

    77. What prefix does Microsoft recommend for menu objects?1. men2. mnn3. mnu

    4. menu

    78. How many arguments are passed to a menu items Click event handler?1. 22. 0

    3. 34. 1

    79. What menu item property do you typically set after loading a menu item as a newmember of a control array?1. Index2. Position3. Name

    4. Visible

    80. What method do you use to display a popup menu?1. PopupMenu2. Show3. ShowMenu4. Popup

    81. Which of these is not a valid constant for the Flags argument when you pop up a menuon the screen?1. vbPopupMenuRightClick2. vbPopupMenuLeftAlign3. vbPopupMenuCenterAlign

    4. vbPopupMenuRightButton

    4. Controls82. Which one of these controls are not in Microsoft Windows Common Controls-2 6.0?

    1. Slider2. Animation control3. Month view4. Updown control

    83. Which of these functions frees Visual Basic to handle other tasks when your code ishandling a long task?1. DoTasks

  • 7/27/2019 Question Bank for VB

    11/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 11 of 11

    2. DoEvents3. DoLoop4. DoProcessing

    84. Which of these is not a standard control property?1. Appearance

    2. Font3. Tag4. Parent

    85. How many values can the Value property of a checkbox take?1. 42. 23. 14. 3

    86. You set the tab order of controls with which property:1. TabOrder2. TabSet3. TabIndex4. Tab

    87. What property of the Controls collection holds the total number of controls in thecollection?1. Total2. Count3. Number4. Max

    88. What method of the Controls collection do you use to remove a control?

    1. Unload2. Remove3. Delete4. Unlink

    89. What event fires when the user drops a control on a form?1. DragDrop2. DragOver3. EndDrag4. Drop

    90. For timer control on a form, the scale interval property is __________1. Seconds

    2. Microseconds3. Milliseconds4. Mega seconds

    91. For which control, you can set STRETCH property equal to TRUE1. Command Button2. Image3. Picture4. Scroll Bar

    92. The text a Label displays is set by what property?1. Text2. Print

  • 7/27/2019 Question Bank for VB

    12/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 12 of 12

    3. Caption4. Property

    93. If the Enable property of an object is set to False, can the object react to user generatedevents?1. Yes2. No3. Cant Say4. None of the above

    94. The Interval property would signify that you are using what?1. Timer2. Button3. Label4. Textbox

    95. Why are three-letter mnemonics used when naming controls1. To confuse the programmer2. To identify the type of control3. To make the program run faster4. To reduce the amount of memory required for the program

    96. TreeView uses Nodes Collection to Store data, List View controls use_________collection to store data.1. Arrays2. List Items

    3. Column Headers4. Groups

    97. Which controls act a repository of images for other controls1. Tree View2. List View3. Image List4. Combo Box

    98. Which of the following is not an intrinsic control?1. Text Box Control2. Status Bar Control3. Timer Control4. Shape Control

    99. To retrieve the value of a Check Box named Check1 into a variable Var1, which of thefollowing options can be used

    1. Var1=check1. True2. Var1=Check1. Option3. Check1. Retrieve (Var1)4. Var1=Check1. Value

    100. The initialize Event of a form named frmMain has the following code segmentPrivate Sub Form_Initiaize( )

    With Combo1.Add Item A

    .Add Item B

    .Add Item C

    End With

  • 7/27/2019 Question Bank for VB

    13/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 13 of 13

    End SubWhich of the following will occur?

    1. Combo Box will have elements added, when the form is first initialized.2. Combo Box will have elements added, every time the form is loaded.3. Application will generate a run time error that combo box control cannot be populated

    in the Initialize event.4. None of the above.

    101. Which of the following controls can be placed on an MDI Parent Form?1. Text Box Control2. DTPicker Control3. Picture Box

    4. Image control

    102. Which controls let you display information in a hierarchical structure1. Tree View

    2. List View3. List Box4. Status Bar

    103. What is the purpose of Image List Control?1. To display bitmaps for the user to view.2. To provide repository for images used by other controls.

    3. To change image format.4. To provide a repository for images icon for class module.

    104. All the statements are the true except1. You can have only one tool bar on a bar.2. Tool Bar can be positioned anywhere on MDI form.

    3. User can customize Tool Bar.4. Both 1 and 2.

    105. Which view will display the detailed information of a list item that is contained inthe sub item array1. Icon View2. Small Icon View3. List View.4. Report View.

    106. The height of images stored in an ImageList is held in what property?1. ImageHeight2. ViewportHeight

    3. ImagesHeight4. Height

    107. Which of the following is not a property of the TreeView control?1. Checkboxes2. Tracking3. SelectedItem4. Indentation

    108. What TreeView event fires when a node is closed?1. Close2. CloseNode3. NodeClick

  • 7/27/2019 Question Bank for VB

    14/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 14 of 14

    4. Collapse

    109. What method do you use to determine the number of nodes displayed in a

    TreeView?1. GetVisibleNodes2. GetDisplayedNodes3. GetDisplayedCount4. GetVisibleCount

    110. Which of the following is not a valid Tree View style?1. tvwTextOnly2. tvwTreelinesPictureText3. tvwTreelinesPlusMinusPictureText4. tvwPictureOnly

    111. What argument to the Tree Views Add method specifies the relative placementof the Node object?1. relationship2. key3. relative4. placement

    112. Which of the following is not a possible view type in a List View control?1. Standard

    2. Report3. Small Icon4. List

    113. What List View property determines if a ListItem object is selected when themouse pointer is it?

    1. HotTracking2. HotSelection3. HoverSelection4. AutoSelection

    114. Which property do you use to add an image to a List View item?1. Picture2. Image3. Display4. Icon

    115. The name of the collection that holds images in an ImageList control is:

    1. ImageList2. ImagesList3. Images4. ListImages

    116. What method do you use to store an image in an ImageList at runtime?1. AddItem2. SetPicture3. Add4. Set

  • 7/27/2019 Question Bank for VB

    15/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 15 of 15

    117. To what value do you set the Style property of buttons in a toolbar to group themtogether?1. tbrButtonGroup

    2. tbrGroupButton3. tbrGroup4. tbrGroupButtons

    118. What toolbar style supports hot images?1. tbrTracking2. tbrHot3. tbrFlat4. tbr3D

    119. After the user has customized a toolbar, what method can you use to store thenew toolbar configuration?1. SaveSetting2. SaveToolbar

    3. SaveConfiguration4. Save

    120. What property do you use to access the text displayed in a simple status bar?1. PanelText2. StatusText3. Text4. SimpleText

    121. Which of these is the correct way to refer to an image in a tab strip control?1. Tabstrip1.Tab(1).Images2. Tabstrip1.Tabs(1).Image3. Tabstrip1.Tabs(1).Images(1)

    4. Tabstrip1.Images(1)

    122. Which of the following defines the graphical width of a graphics object1. GraphWidth2. GraphicalWidth3. Width4. ScaleWidth

    123. Which control allows you to create a TCP/IP session1. Internet Transfer Control2. Winsock3. WebBrowser4. None of the above

    5. Working with Database

    124. What is the purpose of a Parameters Collection of an ADO Command object inrelation to stored procedure?1. The parameters collection holds the collection of Result sets returned from the stored

    procedure.2. The parameters collection is used to pass input parameters to stored

    procedure3. The parameters collection is used to create parameters in stored procedure.4. The parameters collection is used to set up the stored procedure.

  • 7/27/2019 Question Bank for VB

    16/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 16 of 16

    125. When working with a database transaction, what method ends the transactionand saves the changes made to the database?1. Begin Trans

    2. Roll Back3. Commit Tans4. Update

    126. The Ado data control is a combination of1. Connection, Command, Record Set2. Connection, Record Set3. Connection, Command4. Record Set, Command

    127. Which Lock Type setting would lock the record only at the time of actual changein database?1. Read Only2. Optimistic

    3. Pessimistic4. Batch Optimistic

    128. Which of the following will create a client side cursor1. Ad Use Client

    2. Ad Use Server3. Ad Use Server Side4. Ad Use Client Side

    129. ADO stands for1. Active-X Data Grid Object2. Active-X Data Object3. Active-X Data Access Object

    4. Active-X Data Base Access Object

    130. Which cursor type setting would you use ii you want tot create a read only cursor.1. Dynamic2. Key Set3. Forward Only4. Read Only.

    131. Which object handles the transaction block on a specific database1. Connection2. Command3. Database4. Record Set

    132. Which of the following SQL statement selects all records from the student table1. SELECT FROM student2. SELECT * FROM student3. SELECT EVERYTHING FROM student4. SELECT ALL FROM student

    133. Which of these is not an DAO object?1. Database2. QueryDef3. DBEngine4. RecordDef

  • 7/27/2019 Question Bank for VB

    17/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 17 of 17

    134. Which DAO object do you use to define a table?1. DefineTable2. Table

    3. TableDefinition4. TableDef

    135. Which of these is not a valid method of the Connection object?1. CommitTrans2. BeginTrans3. RollbackTrans4. EndTrans

    136. What provider-defined property will be present in the Connection objectsProperties collection if the provider supports transactions?1. TransactionsDDF2. Transactions3. TransactionCommit4. Transaction DDL

    137. What Command object property do you use to associate a Command object witha connection?1. Connection2. ActiveConnection3. ConnectionSource4. Connect

    138. What property holds the actual command in a Command object?1. CommandSQL2. CommandText3. Command

    4. CommandString

    139. What Connection object method can you use to create a Parameter object?1. CreateParameter2. GetParameter3. NewParameter4. Parameter

    140. Which of these is not a valid ADO cursor type?1. adOpenKeyset2. adOpenDynamic3. adOpenForward4. adOpenStatic

    141. Which of these is not a valid property of the DAO control?1. Connect2. DataBaseSource3. RecordsetType4. RecordSource

    142. Which of these is not a valid property of the DAO control?1. Exclusive2. DefaultCursorType3. ReadOnly4. DefaultRead

  • 7/27/2019 Question Bank for VB

    18/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 18 of 18

    143. Which of these is not a DAO control method?1. UpdateTable2. Refresh

    3. UpdateRecord4. UpdateControls

    144. Which of these is not a valid DAO control recordset type?1. Dynaset-type2. Table-type3. ForwardOnly-type4. Snapshot-type

    145. Which of these is not a valid property of the ADO data control?1. CacheSize2. BOFAction3. CommandTimeout4. EndTrans

    146. Which of these is not a valid property of the ADO data control?1. CommandResult2. CursorType3. ConnectionString4. CursorLocation

    147. Which of these is not a valid property of the ADO data control?1. LockEngaged2. MaxRecords3. EOFAction4. LockType

    148. Which of these is not a valid event of the ADO data control?1. FieldChangeComplete2. RecordsetReset3. MoveComplete4. WillChangeField

    149. Which of these is not a valid property of the ADO Connection object?1. CommandString2. ConnectionTimeout3. ConnectionAttributes4. Attributes

    150. Which of these is not a valid ADO Connection object property?1. Provider2. CursorLocation3. IsolationLevel4. ConnectionState

    151. Which of these is not a valid DAO Connection object method?1. CommitTrans2. OpenSchema3. StartTrans4. Execute

    152. Which of these is not a valid event of the ADO Connection object?

  • 7/27/2019 Question Bank for VB

    19/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 19 of 19

    1. WillConnect2. CommitTransOK3. Disconnect

    4. ExecuteComplete

    153. Which of these is not a valid property of the ADO Command object?1. CommandState2. Prepared3. ActiveConnection4. CommandText

    154. Which of these is not a valid property of the ADO Parameter object?1. Precision2. Direction3. ParameterType4. Value

    155. Which of these is not a valid property of the ADO Recordset object?1. ActiveConnection2. CursorLocation3. Connection4. AbsolutePage

    156. Which of these is not a valid event of the ADO Recordset object?1. FetchProgress2. FieldChangeComplete3. WillMove4. FieldChange

    6. ActiveX157. What is the file extension of an Active-X control.1. VBP2. AXC3. ACX4. OCX

    158. What VB elements must you use to debug an Active-X DLL?1. Call Stack2. Immediate Window3. Project Group4. Compiler.

    159. Which command-line switch do you use to register an ActiveX EXE?

    1. /reg322. /regserver3. /register4. /reg

    160. You can declare a new object using the New keyword if it has a:1. Parent property2. Was created by Visual Basic3. Type library4. New method

  • 7/27/2019 Question Bank for VB

    20/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 20 of 20

    161. What is the first argument to the GetObject function (which is frequentlyomitted)?1. Pathname of a file

    2. The name of an instantiated object3. The current forms hWnd property4. The objects Class

    162. Which of the following is not true of variables declared with WithEvents?1. WithEvents variables cannot be declared with As New.2. WithEvents variables cannot be declared in standard modules.3. WithEvents variables can be stored in arrays.4. WithEvents variables cannot be declared with As Object.

    163. You can release an instance of an object by:1. Using the Delete function2. Setting the object variable to undefined3. Setting the object variable to 04. Setting the object variable to Nothing

    164. Which of the following is not a property of the App object that you can use withServer Busy and Request Pending messages?1. OleRequestPendingMsgTitle2. OleRequestPendingTimeout3. OleRequestPendingSource

    4. OleRequestPendingMsgText

    165. Which of the following is not a method of the OLE control?1. CreateEmbed2. ReadFromFile3. SaveToOLEFile

    4. CreateLink

    166. Which of these is not a valid setting for an OLE controls SizeMode property?1. VbOLEZoom2. VbOLESizeAutoSize3. VbOLESizeAutoSize4. VbOLESizeClip

    167. Which of these is not a property of the UserControl object?

    1. Ambient2. Constituent3. DataMembers

    4. AccessKeys

    168. Which of these is not a property of the UserControl object?1. ContainedControls2. HotTracking3. MaskPicture4. EventsFrozen

    169. Which of these is not a method of the UserControl object?1. PopupMenu2. PaintPicture3. StopAsyncRead4. Print

  • 7/27/2019 Question Bank for VB

    21/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 21 of 21

    170. Which of these is not an event of the UserControl object?1. AccessKeyPress

    2. AsyncReadStart3. AsyncReadComplete4. EnterFocus

    171. Which of the following is not a property of the AmbientProperties object returnedby a UserControls Ambient property?1. DisplayAsDefault2. MessageReflect3. DisplayName4. MessageTarget

    172. Which of the following is not a property of the Extender object returned by aUserControls Extender property?1. DefaultHelp

    2. Container3. WhatThisHelpID4. ToolTipText

    173. To which event handler should you add code to establish default values forproperties?1. SetDefaults2. InitializeProperties3. LoadProperties4. Initialize

    174. What events occur in what order when a UserControl switches from design timeto runtime?

    1. ReadProperties, WriteProperties, Terminate2. WriteProperties, ReadProperties, Terminate3. WriteProperties, Terminate, ReadProperties4. Terminate, WriteProperties, ReadProperties

    175. Which of the following is not property of the UserDocument object?1. ViewportExtent2. ContainedControls3. ContinuousScroll4. Hyperlink

    176. Which of these is not a method of the UserDocument object?1. PropertyChanged

    2. AsyncWrite3. SetViewport4. CancelAsyncRead

    177. Which of these is not an event of the UserDocument object?1. AsyncReadComplete2. InitProperties3. AsycReadProgress4. ScrollDocument

    178. Which of these is the first event that fires in a lifetime of a UserDocumentobject?1. ReadProperties

  • 7/27/2019 Question Bank for VB

    22/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 22 of 22

    2. Initialize3. Load4. InitProperties

    179. What is the correct order of occurance of InitProperties, Show, and EnterFocusevents of the UserDocument object?1. Show, InitProperties, EnterFocus2. InitProperties, Show, EnterFocus

    3. EnterFocus, Show, InitProperties4. Show, EnterFocus, InitProperties

    180. If the document has saved any propertys value, what event occurs instead ofInitProperties?1. RestoreProperties2. ReadProperties3. GetProperties4. LoadProperties

    181. Which method do you use to indicate to a UserDocument that youve modified itsproperties?1. PropertyChanged2. PropertiesModified3. UpdateProperties4. PropertyModified

    182. What PropertyBag method do you use to load property values?1. LoadProperties2. ReadProperty3. GetProperty4. LoadDefaults

    7. Error Handling183. Which of these is not a main category of application error in Visual Basic?

    1. Middle-tier errors

    2. Syntax errors3. Run-time errors4. Logic errors

    184. Where can you enable or disable auto syntax checking?1. From the Environment page in the Project menus Options dialog2. From the Syntax page in the Project menus Options dialog3. From the Editor page in the Tools menus Options dialog

    4. From the Environment page in the Tools menus Options dialog

    185. Which of these is not a valid setting you can use to specify when Visual Basicbreaks?1. Break on All Errors2. Break in Standard Module

    3. Break in Class Module4. Precision

    186. Which of these is not a valid form of the On Error GoTo statement?1. On Error Resume Last2. On Error GoTo Label

  • 7/27/2019 Question Bank for VB

    23/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 23 of 23

    3. On Error GoTo line#4. On Error Resume Next

    187. With what statement do you cancel error handling?1. On Error GoTo -12. On Error GoTo None3. On Error Resume 04. On Error Resume Next

    188. Which of these is not a valid form of the Resume statement?1. Resume Label2. Resume First3. Resume4. Resume line#

    189. Which of these is not a valid property of the Err object?1. HelpFile2. LastDllError3. Description4. ErrorNumber

    190. Which of these is not an argument you pass to the Raise method?1. helpcontext2. helpfile3. errsource4. number

    191. Which statement is used to trigger an error.1. Load error2. Trigger

    3. Raise Error. Err4. Err.Raise

    192. What form of the On Error statement would you use if you want to ignore theerror raised.1. On Error resume next2. No On Error statement3. On Error go to 04. On Error go to error handling

    Short Question (1 Mark)

    1. Dim x, y as integer. What is x and y data type?X as variant and y as integer.

    2. What is the size of the variant data type?Variant variable size = 22 + Actual data type size.

    3. What is the return type of Instr and Strcmp?Instr integer (Numeric position)Strcmp - integer ( if both the string are equal they result = 0)

  • 7/27/2019 Question Bank for VB

    24/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 24 of 24

    Strcmp (Str1, Str2, Comparetype)Comparing mode = 0 Binary Comparing1 Textual Comparing

    4. What is the max size allowed for Msgbox Prompt and Input Box?1024

    5. Max label caption length.

    2,048

    6. Max Text box length 32,000

    7. Max Control Names length 255.

    8. Extension in Visual BasicFrm, bas, cls, res, vbx, ocx, frx, vbp, exe

    9. What is frx?When some controls like grid and third party control placed in our application then it willcreate frx in run time.

    10. Name some date functionDateadd(), Datediff(), Datepart(), Cdate()

    11. what will be the result for15/4 = 3.75 and 15\4 = 3

    12. What is keyword used to compare to objects?ISOperator Returns Boolean.

    13. How many procedures are in VB?2. function and sub procedures (Ask what is the diff. Between them?)

    14. Where will we give the option explicit keyword and for what?

    In the general declarations section. To trap undeclared variables.

    15. What is Friend Variable?Scope sharable between projects.

    16. What is binding? What are types of binding?Assigning variable with defined memory space.Late Binding - Memory size is allotted in later stage.Ex:- Dim x as objectEarly Binding - Memory size is allotted while declaring itself.New Key word is important.Ex:- Dim x as New Object

    17. What is the difference between Property Get, Set and Let.Let Value is assigned to ActiveX Object from the form.Let Value is retried to ActiveX Object from the form.

  • 7/27/2019 Question Bank for VB

    25/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 25 of 25

    18. What is Mask Edit and why it is used?Control. Restricted data input as well as formatted data output.

    19. Drag and Drop state numbers and functions.State 0 Source control is being dragged with the range of a target.1 Out of the range of a target.2 One positon in the target to another.

    20. What are the type of validation available in VB?Field, Form

    21. With in the form we want to check all the text box control are typed or not? How?For each currentcontrol in controlsif typeof currentcontrol is TextBox thenend ifnext

    22. What is the result of Null * Any value = 0 (Zero).

    23. What is control array and How many we can have it with in the form?Group of control share the same name. Max 32, 767.

    24. What is the default model of the form? And what is it number?VbModaless 0 (Zero) We can able to place another window above this form.

    25. Suppose from form1 to form2 object property settings will arise to ?Invalid procedure call or argument (Run time error 5)

    26. What is the diff between the Std and Class Module?Std Global with in the project. Cls Global through out the all project only thing is we want to

    set the type lib. Class Modules can be Instantiated.

    27. Different type of Instantiation?Private Only for the Specific Module.Public not creatable Private & PublicMulti Use - Variable we have to declare.Single Use Not possible through dll.Global Multiuse Have variable not Required to Declare.Global Single Use - " Only for exe.

    28. How to declare Dll Procedure?Declare function "" lib "" Alias "" (Arg, ..) asReturn type.

    29. What is MDI form? MDI Styles?We can have only one MDI form for a project. Multiple Document Interface. This form type isVBModal. We have set the Child property of the forms to True to place forms inside this MDI.Style availables 1. VbCascade 2. VbTitle Horizontal

    30. How many images can be placed in the image list ?64

    31. What is Inprocess and Out of Process?Inprocess It will run with in the memory. ( Local Machine).Out of Process It will run out of the memory Normally in the server side.

  • 7/27/2019 Question Bank for VB

    26/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 26 of 26

    32. Diff type of Datatypes?LOB (Large Object Data type).CLOB (Stores Character Objects).

    BLOB ( Store Binary Objects such as Graphic, Video Chips and Sound files).BFILE(Store file pointers to LOB It may Contain filename for photos store on CD_ROM).

    33. What is Zorder Method?Object.Zorder = 1 or 0 Place a Specified mdiform form or control at the font or back of the z-order with n its Graphical Level.

    34. What is diff between the Generic Variable and Specific Variable?Generic Variable:Create Object Ex:-Ole-Automation . No need refer the object library.

    Specific Variable:Binding Procedure Early and Late Binding ( Can be Remove from the Memory).

    35. What are properties available in Clip Board?No Properties Available. Only the methods they are SetText, GetText, Setdata(), Getformat(),Clear.

    36. What is Dll?

    Libraries of procedures external to the application but can be called from the application.

    37. What is Tabstrip control? What is the starting Index value? How to locate it?It is tab control to place our controls with in the form in multiple sheets.Index starts with 1. And to identify

    If Tabstrip1.SelectedItem.Index = 1 Then..

    End if

    38. Why we use Treeview Control?To list the hierarchial list of the node objects. Such of files and Directories.

    39. Why we need OLE-Automation?Advantages?Enables an application to exposes objects and methods to other Applications.No need to reserve memory. No need to write functions. Object library that simplifyprogramming tasks. i.e., No need to Object library. (OLB, TLB).

    40. What is the diff between the Create Object and Get object?Create Object - To create an instance of an object.Get Object To get the reference to an existing object.

    41. Have you create Properties and Methods for your own Controls?Properties Public variable of a ClassMethod Public procedure of a class

    42. What is Collection Objects?Similarly to arrays but is preferred over an array because of the following reasons.1. A collection objects uses less Memory than an array.2. It provides methods to add and delete members.3. It does not required reason statement when objects are added or deleted.4. It does not have boundary limitations.

  • 7/27/2019 Question Bank for VB

    27/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 27 of 27

    43. What is Static Variable?Its Scope will be available through out the life time.

    44. Private Dim x as integer.Private cannot be used in front of DIM.

    45. What is Implicit?Instance of specific copy of a class with its own settings for the properties defined in thatclass.Note: The implicity defined variable is never equal to nothing.

    46. What are the scope of the class?Public , private, Friend

    47. Can we able to set Instancing properties like Singleuse, GlobalSingleuse toActiveXDll?No.

    48. In project properties if we set Unattended what is it mean?This cannot have user interface. This can be used for the COM creation.

    49. What are the Style Properties of Combo Box?Simple, Dropdown list We can type and select.Dropdown Compo Only Drop Down.

    50. What are the Style properties of List Box?Simple Single Select , Extended. Multiple Select.

    51. What are the different type of Dialog Box?Predefined, Custom, User Defined.

    52. What is Parser Bug?It is difficult to use database objects declared in a module from within a form.

    53. What is the Dll required for running the VB?Vbrunxxx.dll

    54. Can We create CGI scripts in VB?Yes.

    55. How to change the Mouse Pointer?Screen.MousePointer = VBHourGlass/VBNormal.

    56. How to check the condition in Msgbox?If(Msgbox("Do you want to delete this Record",VbYesNo)=VbYes)Then End if

  • 7/27/2019 Question Bank for VB

    28/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 28 of 28

    Answer the Following in short (2 Marks)

    1. What is difference between datagrid and flexigrid?Datagrid Editable.Flexigrid Non-Editable. (Generally used for Read only purpose.)

    2. What is ADO? What are its objects ?ActiveX Data Object. ADO can access data from both flat files as well as the data bases. I.e.,It is encapsulation of DAO, RDO , OLE that is why we call it as OLE-DB Technology.Objects are Connection, Record Set, Command, Parameter, field, Error, Property.

    3. What is Dataware Control?Any control bound to Data Control.Ex:- Textbox, Check Box, Picture Box, Image Control, Label, List box, Combo Box, DBCombo,

    4. What are two validate with Data Control?Data_Validate, Data_Error.

    5. Record set types and Number available in VB?1- Dynaset, 0 Table, 2 Snap Shot.

    6. Referential Integrity ( Take care By jet database Engine)?Cascade Delete, Cascade Update is done sett ing property of Artibutes.DbRelationDeleteCascade,DbRelationUpdateCascade.

    7. What are the lock available in Visual Basic?2 types of locks. They are 1. Pessimistic Set Lock Edit property = True (default)2.Optimistic - " = False

    8. What is the diff between RDO and ADO?RDO is Hierarchy model where as ADO is Object model. ADO can access data from both flatfiles as well as the data bases. I.e., It is encapsulation of DAO, RDO , OLE that is why we callit as OLE-DB Technology.

    9. How can we call Stored procedure of Back End in RDO and ADO ?In RDO We can call using RDO Query Objects.

    In ADO We can call using Command Objects.

    10. What is the different between Microsoft ODBC Driver and Oracle OBDC Driver?Microsoft ODBC driver will support all the methods and properties of Visual Basic. Where asthe Oracle not.

    11. What are the Technologies for Accessing Database from Visual Basic?DAO, Data Control, RDO, ODBCDIRECT, ADO, ODBC API , 0040.

    12. Calling Stored Procedures in VB?1. Calling Simply the Procedure with out Arguments"Call ProcedureName}"

  • 7/27/2019 Question Bank for VB

    29/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 29 of 29

    2. If it is with Arguments Means thenDeclare the Query Def qySet Qy as New Query def

    Qy.SQL = "{Call ProcedureName(?,?,?)}"qy(0)=val(Txt1.Text)qy(1)=val(Txt2.Text)qy(2)=val(Txt3.Text)

    Set Rs = Qy.OpenresultSetTxt(1)=Rs.RdoColumns(0)

    13. What is MAPI ?Messaging Application programing Interface.

    14. Different type of Passing Value?By value, By ref, Optional, Param Array.

    Note:- Optional keyword cannot be used while declaring arguments for a function usingparam array.

    15. What are the different types of error?Syntax Errors, Runtime , Logic.

    16. What is Seek Method which type of record set is available this?Only in DbOpenTables.Syntax: rs.index = "empno"rs.seek "=" , 10If with our setting the rs.index then run time error will occur.

    17. What is Centralization Error Handling?Writing funciton and calling it when error occurs.

    18. Handling Error in Calling chain.This will call the top most error where the error is handled.

    19. To connect the Data Control with Back end What are all the properties to be set?Data source Name, Record Source Name

    20. How to trap Data Base Error?

    Dim x as RDOErrorX(0).DesX(1).Number

    21. What is view Port?The area under which the container provides the view of the ActiveX Document is know as aview port.

    22. What methods is used for DBGrid in unbound mode?AddData, EditData, Readdata, WriteData.

  • 7/27/2019 Question Bank for VB

    30/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 30 of 30

    23. How to increase the Date corresponding with month,date,year?DateSerial(year(Now),Month(Now)+1,1)

    Hour, min, sec, month, year, dateSerial, dateadd, datediff, weekday, datevalue,timeserial,timevalue.

    24. Setting the Cursors.Default Cursor 0ODBC Cursor (Client side) 1ServerSide Cursors (More Network traffic) - 2

    25. Cursor managementClient Batch Batch up the Multiple SQL Statements in a single string and Send them to theServer at one time.

    26. What are the record set types?RdOpenFowardOnly 0 (Default used only for the read only purpose)RdOpenStatic 1RdOpenDynamic 2RdOpenKeySet 3 (Normally used for the live project)

    27. Diff types of Lock Types?RdConcurReadOnly 0 (Default)RdConcurLock 1 (Pessimitic Locking)RdConcurRowver 2 (Optimistic Lociking)RdConcurValues 3RdConcurBatch 4

    28. What the RDO Methods and Events?Methods Events

    Begin Trans ValidateCommit Trans RepositionRollback Trans ErrorCancel Query CompliedRefreshUpdate ControlsUpdate row

    29. What is Static Cursor?In ADO Snap Shot is called so.

    30. What is Mixed Cursors?Static + Keyset

    31. What is Fire House Cursors?Forward Only Some time Updateable

    32. What is DBSqlPassThrough?It will By Passing the Jet Query Processor.

  • 7/27/2019 Question Bank for VB

    31/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 31 of 31

    33. What is DBFailError?Rolls Back updates if any errors Occurs.

    34. DSN Less Connection?"Server=Oracle; Driver={Microsoft ODBC for Oracle};"

    35. What is RdExecDirect?Bypasses the Creation of a stored procedure to execute the query. Does not apply to Oracle.

    36. RdoParameter Object RdoParameterConstantDirection RdparamInputRdparamInputOutputRdParamOutputNameType

    Value

    37. Dim x, y as integer. What is x and y data type?X as variant and y as integer.

    38. What is the size of the variant data type?Variant variable size = 22 + Actual data type size.

    39. What is the return type of Instr and Strcmp?Instr integer (Numeric position)Strcmp - integer ( if both the string are equal they result = 0)Strcmp (Str1, Str2, Comparetype)Comparing mode = 0 Binary Comparing

    1 Textual Comparing

    SELECT TRUE OR FALSE [T/F]:

    1. Combo Box controls support multiple selections [F]

    2. Image Control can act as a Container for Other Controls [F]

    3. End Command prevent a Query Unload and Unload events from firing [T]

    4. VB uses variant data type by default [T]

    5. Exit Sub statement prevents the Msg Box statement from being erroneously executed during

    the normal execution flow [T].

    6. VB converts source code into p-Code and then interprets it [T].

    7. p-code is faster than real natively compiled code[F]

    8. p-code can be executed step-by-step while the program is running.[T]

    9. If your application spends most of its time accessing database compilation to native code

    significantly improve its performance.[F]

    10. Timer Controls support Left, Top, Width, Height property at run time.[F].

    11. Combo Box height property can be read but not written both at run time as well as design

    time.

  • 7/27/2019 Question Bank for VB

    32/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 32 of 32

    12. Setting the Back Color property of a label Control has no effect if you set the Back style

    property of the label to 0-transparent [T].

    13. VB raises error when you try to assign invalid font names.[F].14. You can move a control from one form to another using Parent Property [F].

    15. You can move a control to another container by assigning a different value to its container

    property [T].

    16. Most controls change their appearance hen they are disabled [T].

    17. Light Weight Controls doesnt correspond to any windows object and are entirely managed by

    VB itself [T].

    18. Missing hWnd property in an external Active-X control mean that the control is windowless

    [F].

    19. The label and frame control support Tab Index but they do not support Tab stop property [T].

    20. All controls support Tag property with few exceptions [F].

    21. VB raises an error if you reference the index property of a control that does not belong to a

    control array [T].

    22. You cannot use Do Event command to refresh a form [F].

    23. Set Focus method raises an error if control is currently disabled [T].

    24. List and Combo Box controls also fire Click events whenever their List Index properties

    change [T].

    25. Firing many change events does not slow down the loading process [F].

    26. Get Focus and Lost Focus, events can be raised when the form contain any control that can

    receive input focus [F].

    27. Key Press event is passed the ANSI code of the key that has been pressed by the user [T].

    28. Key Code parameter is the code of the pressed Key [T].

    29. Key Press, Key down, Key up, dont pose any problems during debugging phase [F].

    30. Click event occurs before a Mouse Down ----Mouse Up sequence and before the extra

    Mouse Move event [F].

    31. If control is clicked and then the mouse is moved outside its client area the click event is

    never raised [T].

    32. Loading a form necessarily mean that the form is going to become visible [F].

    33. If the Terminate event is fired when the form object is already gone VB raises an error [F].

    34. Pset modifies the color of a single pixel on the form surface [T].

    35. Draw Style property affects the graphic output only if Draw Width is set to 1 pixel [T].

    36. Print method always resets the current X property to zero [T].

    37. If a program exclusively uses intrinsic control you need to distribute additional OCX files [F].

    38. Applications based on intrinsic controls usually perform slower on machines with less

    memory [F].

  • 7/27/2019 Question Bank for VB

    33/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 33 of 33

    39. VB programmers prefer to rely on field level validation than key level validation [T].

    40. There is a direct way to determine the currency symbol in VB [F].

    41. If you move a frame control, all the child controls go with it [T].42. Static local variables have scope of local variables and the lifetime of module level variables

    [T].

    43. You cannot store non- homogenous data in a collection [F].

    44. ODBC Direct works only with 32 bit applications [T].

    45. OLE DB is based on COM [T].

    46. DAO and RDO counterparts are more versatile than ADO RecordSet objects [F].

    47. ADO update method doesnt support the capability to update multiple fields at once [F].

    48. To commit the changes to the database on the server Update Batch method is issued [T].

    49. When no more commands are pending, the next RecordSet method returns nothing [T].

    50. In-process server, communicate directly with their clients with the aid of COM [F].

    51. A text box is used primarily to get information from the user.[T]

    52. A picture box can display both text and graphics.[T]

    53. Both text boxes and command buttons have a click event. [T]

    54. A string variable that has not been assigned a value has the value zero [F]

    55. Sub and Function procedures are referred to as gerenral procedures. [T]

    56. Sub and Function procedures are referred to as gerenral procedures. [T]

    57. A Sub procedure is invoked with a statement of the form [F]

    Get ProcedureName

    58. When a value is transmitted between two procedures it is called passing. [T]

    59. The items appearing in the parentheses of a Call statement are called arguments. [T]

    60. The items in parentheses of a Sub procedure are called assignments [F]

    61. Values cannot be passed between Sub procedures and event procedures, they can only be

    passed between two Sub procedures [F]

    62. When information is passed from one Sub procedure to another and then passed back to the

    Call statement it is said to have been passed by reference [T]

    63. Passing a value from an event procedure to a Sub procedure is called passing by value. [F]

    64. Any variable that is not declared in a function is said to be form level [F]

    FILL IN THE BLANKS:

    1. The Properties Window lists all the properties of the object that is currently selected and

    gives you the opportunity to modify them.

    2. The Call Stack Window shows all the procedures that are waiting for the current procedure

    to complete.

    3. The Frame control is typically used as a container for other controls.

  • 7/27/2019 Question Bank for VB

    34/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 34 of 34

    4. Combo Box control is a combination of Textbox and List Box controls.

    5. Option Explicit statement will automatically trap any attempt to use a variable that is not

    declared anywhere in program code.6. You can stop any VB program running in the environment by invoking the End Command.

    7. Change is the default event for Textbox Controls.

    8. Click is the default event for the Command Button Controls.

    9. p-Code compiled executables are often smaller than programs compiled to native code.

    10. Top and Left Properties are by default measured in [twips]

    11. Fore Color and Back Color Properties affect the color of the text and color of background

    respectively.

    12. You can use Set command to assign whole font objects to controls.

    13. The Parent Property is a run time property, which returns a reference to the form that hoststhe control.

    14. The Container property is a run time property which, returns reference to the container of the

    control.

    15. VB controls can be grouped in 2 categories: Standard Controls and Light

    Weight/Windowless Controls.

    16. If a control supports Tab Stop property it also supports Tab Index property.

    17. Mouse Pointer and Mouse Icon property affect the shape of mouse cursor when it hovers

    over a control.

    18. Before advent of OLE and Com DDE (Dynamic Data Exchange) was the preferred way for 2

    Window programs to communicate.

    19. The Refresh method causes the control to be redrawn.

    20. The Zorder method affects the visibility of control with respect to other overlapping controls.

    21. Textbox raises Change event when the user types something in editable area of control.

    22. Combo Box control raises a Click event when the user selects an item from the list position.

    23. You need chr$() function to convert ANSI code to string.

    24. Key Down and Key Up events receive two parameters Key Code and Shift.

    25. Shift is an int value that reports the state of the Ctrl Shift and Alt Keys.

    26. If the Forms Key Preview property is set to true the form object receives all he Keyboard

    related events before they are sent to the control that currently has the input focus.

    27. A form becomes visible only if you invoke its Show method.

    28. Paint event doesnt fire if Forms Auto Redraw property is set to True.

    29. Twips can be easily converted into pixels using Screen Objects [Twips PerPixelX ] and

    [TwipsPerPixelY ]properties.

    30. Active Form is a read only property that returns a reference to the active from in the current

    application.

  • 7/27/2019 Question Bank for VB

    35/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 35 of 35

    31. If you want to print a message and at the sane time you want to erase a previous message in

    the same position you can do it by setting the Font Transparent to False.

    32. Point method returns the RGB color value of a given value.33. Line method supports step keyword to specify relative positioning.

    34. Aspect Ratio is the number you get when you divide the Y-radius by the X-radius of the

    ellipse.

    35. Rubber Banding is the effect, which has the ability to draw and resize new shapes using the

    mouse without disturbing the underlying graphics.

    36. Form object exposes 2 methods that let you easily convert between different units of

    measurement Scale X method and Scale Y method.

    37. The halftone palette is a special fixed palette that contains an assortment of average colors.

    38. The [Sel Start ] property sets or returns the position of the blinking caret.39. The Filter String routine filters out all unwanted characters in a string.

    40. VB ignores the Scroll Bar property if Multi Line is False.

    41. The lifetime of a variable is the time period during which that variable stays alive and use

    memory.

    42. Copy Memory function lets you move a block of bytes from one memory address to another

    memory address.

    43. The Is Missing function test the variant and return, True if it contains this value.

    44. You can implement a routine that accepts any number of arguments using the [Param

    Array] keyword.

    45. You can test the type an object variable using the [Type Of----Is] statement.

    46. RDO is an object model, which by-passes the Jet Engine and DAO DLL and works directly

    with the underlying OBC drivers.

    47. ADO is the high level interface to the OLEDB.

    48. You can define a timeout for the connection with the Connection Timeout property.

    49. The Will Change Record fires immediately before the ADO Data Control writes data to the

    database.

    50. Active Connection is a reference to an ADO Connection Object that identifies the provider

    and data source.

    51. Marshalling is the operation that COM executes each time data has to be passed from a

    client to an out-of-process server and back.

    52. API Viewer tool assists in framing of the declaration of an API using VB syntax.

    53. Regsvr32 .exe is the application that registers an Active-X DLL on a machine.

    54. Image List Active-X control can be used to add images to a toolbar.

    55. [Command() ] returns any Command Line Parameters passed to a particular EXE in VB.

    56. Style and Picture properties must be set to display image in a command button.

  • 7/27/2019 Question Bank for VB

    36/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 36 of 36

    57. Data Source and Data Field property must be set to make a Text Box control as a data

    aware control.

    58. RAD stands for Rapid Application Development.

    SHORT ANSWER TYPE QUESTIONS:

    1. Why the new operator is slightly faster than create object?

    2. Write any way to permanently register an active-X server.

    3. What are resource files?

    4. What are system objects and list some of them in brief.

    5. Describe some VB components.

    6. State some of the differences between MDI and SDI applications.

    7. List few advantages of p-code over native code.

    8. Write the syntax of with statement with an example.

    9. Describe zorder method with its syntax.

    10. Describe rubber banding effect and how its achieved?

    11. Give the syntax of pset method and where it is used?

    12. Explain now function?

    13. What method would you use to read CLA (command line arguments)

    14. Explain in brief the instancing property.15. What property of which object would you use to find about the running sate of the control?

    16. What property of record set object in ADO would you use to know whether the record set is in

    edit mode or add mode? What are the possible values?

    17. What are the 3 objects you use in the active-x control projects?

    18. Under what conditions you prefer to use control arrays?

    19. What is an overflow error?

    20. Give the syntax of multi select property?

    21. Explain the use of preserve keyword?

    22. Write 3 functions that are used in converting the case of the string?23. How mid statement differs from mid$() function?

    24. Write the syntax of get and put statement.

    25. Draw a sketch of ado object model.

    26. How can we disable a control but still display it in an active state?

    27. Why lightweight controls dont expose an hwnd property?

    28. Why the move method should always be preferred to individual property assignment?

    29. Why should you avoid using set focus method in the form_load event, when all controls are

    not yet visible?

  • 7/27/2019 Question Bank for VB

    37/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 37 of 37

    30. Give the sequence of the events fired whenever the end user presses a key while the control

    has the input focus.

    31. Write the complete event sequence when the user double clicks on a control.32. If a control is clicked and then the mouse is moved outside its client area. What will happen?

    33. If you double click a control and then move the mouse outside its client area. Which events

    would be fired?

    34. When the scale height property should be set negative?

    35. Explain how can you use command object to run a row-returning query in different ways?

    36. What are the similarities between label and frame controls?

    37. State the difference between picture box and image controls?

    38. "Control arrays add a lot of flexibility to the program." Support this statement.

    39. Why conventional strings are usually faster than fixed length strings?40. Give an example of passing by value and by reference in vb.

    41. What are the rules that dictate param array keyword?

    42. What are unanticipated errors?

    43. Describe late binding in brief?

    44. How polymorphism is achieved in VB?

    45. Describe inheritance through delegation and state some of the benefits of inheritance.

    46. Describe tree view control.

    47. Describe event multicasting.

    48. List the methods exposed by the common dialog control.

    49. List few things that the methods of connection object can do.

    50. Write syntax for updating, inserting and deleting records.

    LONG ANSWER QUESTION [ 5 MARKS ]:

    1. List the types of COM components and explain them in detail.

    2. State and explain the difference between in-process and out-of-process components.

    3. Write the difference between active-x DLL and standard exe program.

    4. List the advantages of multithreading.5. What is data customer class and explain its types.

    6. Explain the event driven model of vb.

    7. Difference between simple and complex binding.

    8. How would you debug an active-x DLL?

    9. Give example of inheritance in vb.

    10. What is early and dynamic binding? Explain them giving examples.

    11. Explain forms life cycle in terms of their events.

  • 7/27/2019 Question Bank for VB

    38/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    Page 38 of 38

    12. What is the use of the use of common dialog control? How many dialog boxes can we

    display using common dialog control?

    13. Describe error handling with the on-error statement.14. Explain with an example passing an array to procedure.

    15. Explain different types of record set.

    16. List and explain different DAO objects.

    17. List and describe some of the arguments you can use in the connection string property.

    18. You can stop running VB program by invoking the end command but this isnt a good

    approach. Why?

    19. Describe few points why one would like to decide to create a p-code executable?

    20. State the difference between standard and windowless controls.

    21. Describe the form life cycle.22. List some advantages of intrinsic controls over external control.

    23. What are the flaws in the validation scheme of VB?

    24. Define collections and how they are different from arrays?

    25. Describe the system object hierarchy.

    26. What is the sequence of operations performed by run time module when VB creates an

    object of a given class for the first time?

    27. Describe the type of relationships among objects.

    28. Explain the access of database to the VB application using ODBC, DAO, RDO and ADO with

    the help of a sketch.

    29. List the task you can perform using database diagram window.

    30. What are the operations you can perform using query builder window.

    31. ADO based binding technique is a revolution in how you display data from database. Support

    this statement.

    32. State some peculiarities of MDI form.

    33. How can we add images at runtime? Give the syntax of the method used and write the code.

    34. Write the code to show an image in the upper left corner of the picture box control.

    35. Explain 3 main independent objects of ado.

    36. List and explain some events exposed by connection object.

    37. Explain cursor and its types and which cursor is the default for server side.

    38. What are the techniques used to improve the performance of the application while using

    cursor?

    39. Explain opening and closing of the record set?

    40. Explain hte methods supported by command object?

    41. Write steps to build the connection string.

  • 7/27/2019 Question Bank for VB

    39/39

    ACTS National Resource Center, Pune

    Question BankVisual Basic (VB) (Solved/Unsolved)

    42. What are cursors good for? why most heavy duty client/server applications rely on cursor less

    record sets for retrieving data.

    43. Explain insertion, deletion and updation of records.44. Explain field and record validation with an example.

    45. Explain the properties of data combo and data list controls.

    46. Explain the object model of the data grid control with a diagram.

    47. Explain types of COM components in detail.

    48. Differentiate between

    a) optimistic and pessimistic locking.

    b) get, let and set property procedures.

    49. Write brief notes on following debugging tools

    a) local windowb) watch window

    c) immediate window

    50. What advantage does list view control have over the standard list box?

    51. What is the significance of "with events" keyword?

    52. Dim Adoconn As ADODB.ConnectionDim Rstemp As ADODB.RecordsetPrivate Sub Form_Load()Rstemp.Activeconnection=Adoconn..

    .

    .End sub

    Comment on the above code set and also give the correct code.