Вы находитесь на странице: 1из 39

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)

Multiple Choice Questions


1. How many versions of Visual Basic are there? 1. 1 2. 3 3. 2 4. 4 2. Which version of Visual Basic comes with Visual SourceSafe? 1. Standard version 2. Learning version 3. Enterprise version 4. 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 View 2. Project Explorer 3. Code window 4. Properties Window The Components item is in which menu? 1. Project 2. Tools 3. Edit 4. Run

5.

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. Borland 2. Sun Microsystems 3. Microsoft 4. Apple 8. Who is your #1 source for Visual Basic tutorials and information? 1. Somebody I know 2. The Visual Basic Almanac 3. Good Question 4. I don' t know 9. .lpk is the extension for what kind of file? 1. Workspace files 2. License files 3. Intermediate list files 4. Link files

Page 1 of 1

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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 standard module needs to be explicitly initialized. 1. 2. 3. 4. Only a is True.. Both a and b are True. Both a and b are False. Only b is True.

11. Where do you set the version of a project? 1. Version tab of the Project Properties dialog 2. General tab of the Project Properties dialog 3. Make tab of the Project Properties dialog 4. Build tab of the Project Properties dialog 12. If Visual Basic doesn' t offer you the option of bringing up the Visual Component Manager, 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. Fundamentals

13. What const you need to pass to msgBox to make it System Modal Dialog. 1. VB App Modal 2. VB Sys Modal 3. VB System Modal 4. VB Windows Modal

14. Which of these keywords may not be used to declare a variable? 1. Dim 2. Class 3. Private 4. Public 15. Which of these is not a legal way to name a variable? 1. Using underscore (_) in the name 2. Starting the name with a letter 3. Making the variable name more than 127 characters long 4. Starting the name with a number 16. Which statement would you use to force declaration of all variables in a module? 1. Option Base 2. Option Explicit 3. Option Private 4. Option Declare 17. This statement: Public intArray(900) As Integer, declares an array with how many elements? 1. 900 2. 1800 3. 899 4. 901

Page 2 of 2

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
18. Which of the following is not an intrinsic Visual Basic data format? 1. Currency 2. Date 3. Object 4. Float 19. Variables declared at the module level in the modules (General) section using Public are available: 1. Throughout the project 2. In Public subroutines in the module only 3. Throughout the module but not the project 4. Throughout the project and the project group 20. Which of these is not a valid setting for the Flags property of the Common Dialogs control when you use the ShowFont method? 1. cdlCFBoth 2. cdlCFPrinterFonts 3. cdlCFInstalledFonts 4. cdlCFScreenFonts 21. The number of milliseconds between timer ticks is held in what property? 1. Milliseconds 2. Time 3. Period 4. Interval 22. Is this legal: /* This is a /* nested */ comment */ 1. Yes 2. No 3. Cant say 4. 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 11 2. If y = 10, x will be assigned 9 and y will become 9 3. 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 nothing 2. The square function returns an integer 3. The square function returns x 4. None of the above 26. x = strlen("Juicy"); 1. x would equal 5 2. x would equal 6 3. x would equal 0 4. Would produce a syntax error

Page 3 of 3

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
27. What is the function, "malloc", used for 1. Allocate memory 2. Locate malformed statements 3. Locate the maths library 4. To shop occasionally 28. Why is the "dot notation" used with structures 1. To declare the structure 2. To access the structure members 3. To access the structure members if the structure is a pointer 4. None of the above 29. What of the following best describes a linked list 1. A function that calls itself 2. A multi-dimensional array 3. A self-referential data structure 4. A valid open file 30. which of the following could be used to write to a file 1. fprint 2. fprintf 3. printff 4. printfile 31. txtcopy first.txt second.txt 1. 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 body 2. Private methods with empty body 3. 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 terminate 2. Query Unload, Unload and terminate 3. Unload only 4. Query Unload and Unload. 34. How do you create a read only property in a class? 1. Create only a property let procedure 2. Create only a property get procedure 3. 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 event 2. Set event 3. Trigger 4. Fire Event 36. Which of the following function declaration is valid?

Page 4 of 4

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
1. 2. 3. 4. Declare Private function Get Value (name: =String): =Integer Function Get Value (name as String) as Integer Declare Public Get Value (name as String) as Function Declare Get Value (name as String) as Function

37. When declaring a variable, what do you begin the statement with? 1. Dec 2. Declare 3. Dim 4. Int 38. What does an If statement do? 1. Compares two conditions 2. Produces an sytax error 3. Can only compare strings and integers 4. Used as a boolean operator 39. The For statement signifies that what statement will eventually follow? 1. Loop 2. Next 3. Goto 4. Back 40. Which of the following statements will exit your program? 1. Exit 2. End 3. Stop 4. Shell 41. Can two Strings, whose characters are numbers, do mathematical operations? 1. Yes 2. No 3. May be 4. Depends on the condition 42. In the following code segment, what would use the value of x in the MsgBox? Dim X as Integer Private Sub Display Value () X=10 Call Alter Value (X) MsgBox Value of X= &X End Sub 1. 2. 3. 4. An error message will be generated 100 10 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

Page 5 of 5

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
Private Sub Code Example Dim X as Integer X=100 X=sqrt(X) If X<> 100 Then MsgBox X End Sub On Execution of the above code, what will happen? 1. 2. 3. 4. 10,000 10 Compile error No output

45. What will be the output of the following code? Dim Indy As Integer For Indy =1 To 10 step1 Debug. Print Indy Indy=Indy+2 Next Indy 1. 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 step 5 MsgBox k*k Next k 2. For k=100 to 10 step 5 MsgBox k*k Next 3. Select case k case 10: MsgBox k*k case Else : End Select 4. For I=1 to 100 Next I 47. Msg Box 23+7 will return? 1. 2. 3. 4. 30 237 23+7 Compilation Error

48. What is the return type of the Msg Box Function? 1. Int 2. String 3. Object 4. MsgBox( ) doesnt support any value 49. If a procedure name Calculate requires 2 parameters that cannot be internally changed and 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 Long 2. Function Calculate (By Val Dim X As Integer, By Val Int Y As Integer) as Long

Page 6 of 6

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
3. Function Calculate (Int x As Integer, Int Y As Integer) as Long 4. None of the above. 50. Private Sub My Sub () as Integer Static Count as Integer If Count>=4 then Exit Sub Else My Sub End If End Sub What will be the output of MySub 1. 2. 3. 4. Compile Error Out Of Stack Error 4 0

51. Which data type is most suitable for storing an Age 1. Single 2. Double 3. String 4. Variant 52. End For can be used to leave a For/Next Loop early 1. True 2. False 53. Which of the following is the correct syntax to count backwards 1. For counter = 10 Down To 1 2. For counter = 10 To 1 Step -1 3. For counter = 10 To 1 Step Down 4. 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 Automatic 1. The MouseDown, MouseMove and MouseUp Event are disabled 2. The MouseDown, MouseUp and Click Event are disabled 3. The GotFocus Event is disabled 4. 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-only 1. ByValue 2. ByReference 3. ByVal 4. ByRef 57. Which event s used to store persistent data for controls property. 1. Write Data 2. Write Property 3. Read Property

Page 7 of 7

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
4. Read Saved Data 58. In the VB development environment____________ shortcut key is used to open the properties window? 1. F5 2. Ctrl + P 3. Alt + P 4. F4

2. Working with Forms

59. Which of the following is not an issue of code maintainability? 1. Be modular 2. Use comments 3. Use consistent variable names 4. Select Compiler Options carefully 60. How many MDI forms can a project have 1. 0 2. 1 3. 2 4. 3 61. State which of the following statements is TRUE 1. 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 loaded 4. When form is resized. 63. .Which of the following events will be fired first when a form is loaded first? 1. Initialize event 2. Paint event 3. Resize event 4. Load event 64. What object holds the currently active form? 1. The Screen objects ActiveForm object 2. The App objects Form object 3. The App objects ActiveForm object 4. The Screen objects Form object 65. When a form loads, what events happen in what order? 1. Load, Initialize, GotFocus 2. Initialize, Load, GotFocus 3. Activate, Initialize, Load 4. Load, Activate, GotFocus 66. When a form is unloaded, what events happen in what order? 1. QueryUnload, Unload, Terminate

Page 8 of 8

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
2. 3. 4. Deactivate, Unload, Terminate Unload, Deactivate, Terminate QueryUnload, Terminate, Unload

67. Among the following, which is the valid method for making an EXE file of your VB application 1. From the command prompt, execute the command make EXE 2. 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.load 2. Dim frmRun as Form1 3. Set frmRun=Create Form 1 4. Set frmRun=New Form 1 69. Which form property holds the forms Windows handle? 1. hWnd 2. Handle 3. hWindowHandle 4. hWindow 70. What property lets you set a forms original screen position? 1. OriginalPosition 2. StartPosition 3. Position 4. StartupPosition 71. Which of the following is not a valid value for the UnloadMode argument of the QueryUnload event handler? 1. vbFormControlMenu 2. vbAppWindows 3. vbFormCode 4. vbFormUnload 72. What argument(s) is/are passed to the KeyUp and KeyDown event handlers? 1. KeyCode 2. KeyAscii 3. KeyAscii, Shift 4. KeyCode, Shift

3. Menu

73. The Parent property of a menu object holds which of these items? 1. The Screen object 2. The menu bar object 3. The App object 4. The forms hWnd value 74. Menu Item fires a click event when 1. User clicks on it. 2. User presses shortcut keys. 3. User presses hot keys. 4. Never

Page 9 of 9

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
75. What property specifies whether or not top-level Menu controls are displayed on the menu bar while a linked object or embedded object on a form is active? 1. NegotiateMenus 2. NegotiateMenuBar 3. NegotiatePosition 4. 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. men 2. mnn 3. mnu 4. menu 78. How many arguments are passed to a menu items Click event handler? 1. 2 2. 0 3. 3 4. 1 79. What menu item property do you typically set after loading a menu item as a new member of a control array? 1. Index 2. Position 3. Name 4. Visible 80. What method do you use to display a popup menu? 1. PopupMenu 2. Show 3. ShowMenu 4. Popup 81. Which of these is not a valid constant for the Flags argument when you pop up a menu on the screen? 1. vbPopupMenuRightClick 2. vbPopupMenuLeftAlign 3. vbPopupMenuCenterAlign 4. vbPopupMenuRightButton

4. Controls

82. Which one of these controls are not in Microsoft Windows Common Controls-2 6.0? 1. Slider 2. Animation control 3. Month view 4. Updown control

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

Page 10 of 10

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
2. 3. 4. DoEvents DoLoop DoProcessing

84. Which of these is not a standard control property? 1. Appearance 2. Font 3. Tag 4. Parent 85. How many values can the Value property of a checkbox take? 1. 4 2. 2 3. 1 4. 3 86. You set the tab order of controls with which property: 1. TabOrder 2. TabSet 3. TabIndex 4. Tab 87. What property of the Controls collection holds the total number of controls in the collection? 1. Total 2. Count 3. Number 4. Max 88. What method of the Controls collection do you use to remove a control? 1. Unload 2. Remove 3. Delete 4. Unlink 89. What event fires when the user drops a control on a form? 1. DragDrop 2. DragOver 3. EndDrag 4. Drop 90. For timer control on a form, the scale interval property is __________ 1. Seconds 2. Microseconds 3. Milliseconds 4. Mega seconds 91. For which control, you can set STRETCH property equal to TRUE 1. Command Button 2. Image 3. Picture 4. Scroll Bar 92. The text a Label displays is set by what property? 1. Text 2. Print

Page 11 of 11

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
3. Caption 4. Property 93. If the Enable property of an object is set to False, can the object react to user generated events? 1. Yes 2. No 3. Cant Say 4. None of the above 94. The Interval property would signify that you are using what? 1. Timer 2. Button 3. Label 4. Textbox 95. Why are three-letter mnemonics used when naming controls 1. To confuse the programmer 2. To identify the type of control 3. To make the program run faster 4. 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. Arrays 2. List Items 3. Column Headers 4. Groups 97. Which controls act a repository of images for other controls 1. Tree View 2. List View 3. Image List 4. Combo Box 98. Which of the following is not an intrinsic control? 1. Text Box Control 2. Status Bar Control 3. Timer Control 4. Shape Control 99. To retrieve the value of a Check Box named Check1 into a variable Var1, which of the following options can be used 1. Var1=check1. True 2. Var1=Check1. Option 3. Check1. Retrieve (Var1) 4. Var1=Check1. Value 100. The initialize Event of a form named frmMain has the following code segment Private Sub Form_Initiaize( ) With Combo1 .Add Item A .Add Item B .Add Item C End With

Page 12 of 12

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
End Sub Which 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. 1. 2. 3. 4. 102. 1. 2. 3. 4. 103. 1. 2. 3. 4. 104. 1. 2. 3. 4. Which of the following controls can be placed on an MDI Parent Form? Text Box Control DTPicker Control Picture Box Image control Which controls let you display information in a hierarchical structure Tree View List View List Box Status Bar What is the purpose of Image List Control? To display bitmaps for the user to view. To provide repository for images used by other controls. To change image format. To provide a repository for images icon for class module. All the statements are the true except You can have only one tool bar on a bar. Tool Bar can be positioned anywhere on MDI form. User can customize Tool Bar. Both 1 and 2.

105. Which view will display the detailed information of a list item that is contained in the sub item array 1. Icon View 2. Small Icon View 3. List View. 4. Report View. 106. The height of images stored in an ImageList is held in what property? 1. ImageHeight 2. ViewportHeight 3. ImagesHeight 4. Height 107. Which of the following is not a property of the TreeView control? 1. Checkboxes 2. Tracking 3. SelectedItem 4. Indentation 108. What TreeView event fires when a node is closed? 1. Close 2. CloseNode 3. NodeClick

Page 13 of 13

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
4. Collapse

109. What method do you use to determine the number of nodes displayed in a TreeView? 1. GetVisibleNodes 2. GetDisplayedNodes 3. GetDisplayedCount 4. GetVisibleCount 110. Which of the following is not a valid Tree View style? 1. tvwTextOnly 2. tvwTreelinesPictureText 3. tvwTreelinesPlusMinusPictureText 4. tvwPictureOnly 111. What argument to the Tree Views Add method specifies the relative placement of the Node object? 1. relationship 2. key 3. relative 4. placement 112. Which of the following is not a possible view type in a List View control? 1. Standard 2. Report 3. Small Icon 4. List 113. What List View property determines if a ListItem object is selected when the mouse pointer is it? 1. HotTracking 2. HotSelection 3. HoverSelection 4. AutoSelection 114. Which property do you use to add an image to a List View item? 1. Picture 2. Image 3. Display 4. Icon 115. 1. 2. 3. 4. The name of the collection that holds images in an ImageList control is: ImageList ImagesList Images ListImages

116. What method do you use to store an image in an ImageList at runtime? 1. AddItem 2. SetPicture 3. Add 4. Set

Page 14 of 14

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
117. To what value do you set the Style property of buttons in a toolbar to group them together? 1. tbrButtonGroup 2. tbrGroupButton 3. tbrGroup 4. tbrGroupButtons 118. What toolbar style supports hot images? 1. tbrTracking 2. tbrHot 3. tbrFlat 4. tbr3D 119. After the user has customized a toolbar, what method can you use to store the new toolbar configuration? 1. SaveSetting 2. SaveToolbar 3. SaveConfiguration 4. Save 120. What property do you use to access the text displayed in a simple status bar? 1. PanelText 2. StatusText 3. Text 4. SimpleText 121. Which of these is the correct way to refer to an image in a tab strip control? 1. Tabstrip1.Tab(1).Images 2. Tabstrip1.Tabs(1).Image 3. Tabstrip1.Tabs(1).Images(1) 4. Tabstrip1.Images(1) 122. Which of the following defines the graphical width of a graphics object 1. GraphWidth 2. GraphicalWidth 3. Width 4. ScaleWidth 123. Which control allows you to create a TCP/IP session 1. Internet Transfer Control 2. Winsock 3. WebBrowser 4. None of the above

5. Working with Database


124. What is the purpose of a Parameters Collection of an ADO Command object in relation 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 procedure 3. The parameters collection is used to create parameters in stored procedure. 4. The parameters collection is used to set up the stored procedure.

Page 15 of 15

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
125. When working with a database transaction, what method ends the transaction and saves the changes made to the database? 1. Begin Trans 2. Roll Back 3. Commit Tans 4. Update 126. 1. 2. 3. 4. The Ado data control is a combination of Connection, Command, Record Set Connection, Record Set Connection, Command Record Set, Command

127. Which Lock Type setting would lock the record only at the time of actual change in database? 1. Read Only 2. Optimistic 3. Pessimistic 4. Batch Optimistic 128. 1. 2. 3. 4. 129. 1. 2. 3. 4. 130. 1. 2. 3. 4. 131. 1. 2. 3. 4. 132. 1. 2. 3. 4. Which of the following will create a client side cursor Ad Use Client Ad Use Server Ad Use Server Side Ad Use Client Side ADO stands for Active-X Data Grid Object Active-X Data Object Active-X Data Access Object Active-X Data Base Access Object Which cursor type setting would you use ii you want tot create a read only cursor. Dynamic Key Set Forward Only Read Only. Which object handles the transaction block on a specific database Connection Command Database Record Set Which of the following SQL statement selects all records from the student table SELECT FROM student SELECT * FROM student SELECT EVERYTHING FROM student SELECT ALL FROM student

133. Which of these is not an DAO object? 1. Database 2. QueryDef 3. DBEngine 4. RecordDef

Page 16 of 16

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
134. Which DAO object do you use to define a table? 1. DefineTable 2. Table 3. TableDefinition 4. TableDef 135. Which of these is not a valid method of the Connection object? 1. CommitTrans 2. BeginTrans 3. RollbackTrans 4. EndTrans 136. What provider-defined property will be present in the Connection objects Properties collection if the provider supports transactions? 1. TransactionsDDF 2. Transactions 3. TransactionCommit 4. Transaction DDL 137. What Command object property do you use to associate a Command object with a connection? 1. Connection 2. ActiveConnection 3. ConnectionSource 4. Connect 138. What property holds the actual command in a Command object? 1. CommandSQL 2. CommandText 3. Command 4. CommandString 139. What Connection object method can you use to create a Parameter object? 1. CreateParameter 2. GetParameter 3. NewParameter 4. Parameter 140. Which of these is not a valid ADO cursor type? 1. adOpenKeyset 2. adOpenDynamic 3. adOpenForward 4. adOpenStatic 141. Which of these is not a valid property of the DAO control? 1. Connect 2. DataBaseSource 3. RecordsetType 4. RecordSource 142. Which of these is not a valid property of the DAO control? 1. Exclusive 2. DefaultCursorType 3. ReadOnly 4. DefaultRead

Page 17 of 17

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
143. Which of these is not a DAO control method? 1. UpdateTable 2. Refresh 3. UpdateRecord 4. UpdateControls 144. Which of these is not a valid DAO control recordset type? 1. Dynaset-type 2. Table-type 3. ForwardOnly-type 4. Snapshot-type 145. Which of these is not a valid property of the ADO data control? 1. CacheSize 2. BOFAction 3. CommandTimeout 4. EndTrans 146. Which of these is not a valid property of the ADO data control? 1. CommandResult 2. CursorType 3. ConnectionString 4. CursorLocation 147. Which of these is not a valid property of the ADO data control? 1. LockEngaged 2. MaxRecords 3. EOFAction 4. LockType 148. Which of these is not a valid event of the ADO data control? 1. FieldChangeComplete 2. RecordsetReset 3. MoveComplete 4. WillChangeField 149. Which of these is not a valid property of the ADO Connection object? 1. CommandString 2. ConnectionTimeout 3. ConnectionAttributes 4. Attributes 150. Which of these is not a valid ADO Connection object property? 1. Provider 2. CursorLocation 3. IsolationLevel 4. ConnectionState 151. Which of these is not a valid DAO Connection object method? 1. CommitTrans 2. OpenSchema 3. StartTrans 4. Execute 152. Which of these is not a valid event of the ADO Connection object?

Page 18 of 18

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
1. WillConnect 2. CommitTransOK 3. Disconnect 4. ExecuteComplete 153. Which of these is not a valid property of the ADO Command object? 1. CommandState 2. Prepared 3. ActiveConnection 4. CommandText 154. Which of these is not a valid property of the ADO Parameter object? 1. Precision 2. Direction 3. ParameterType 4. Value 155. Which of these is not a valid property of the ADO Recordset object? 1. ActiveConnection 2. CursorLocation 3. Connection 4. AbsolutePage 156. Which of these is not a valid event of the ADO Recordset object? 1. FetchProgress 2. FieldChangeComplete 3. WillMove 4. FieldChange

6. ActiveX
157. 1. 2. 3. 4.

What is the file extension of an Active-X control. VBP AXC ACX OCX What VB elements must you use to debug an Active-X DLL? Call Stack Immediate Window Project Group Compiler.

158. 1. 2. 3. 4.

159. Which command-line switch do you use to register an ActiveX EXE? 1. /reg32 2. /regserver 3. /register 4. /reg 160. You can declare a new object using the New keyword if it has a: 1. Parent property 2. Was created by Visual Basic 3. Type library 4. New method

Page 19 of 19

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
161. What is the first argument to the GetObject function (which is frequently omitted)? 1. Pathname of a file 2. The name of an instantiated object 3. The current forms hWnd property 4. 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 function 2. Setting the object variable to undefined 3. Setting the object variable to 0 4. Setting the object variable to Nothing 164. Which of the following is not a property of the App object that you can use with Server Busy and Request Pending messages? 1. OleRequestPendingMsgTitle 2. OleRequestPendingTimeout 3. OleRequestPendingSource 4. OleRequestPendingMsgText 165. Which of the following is not a method of the OLE control? 1. CreateEmbed 2. ReadFromFile 3. SaveToOLEFile 4. CreateLink 166. Which of these is not a valid setting for an OLE controls SizeMode property? 1. VbOLEZoom 2. VbOLESizeAutoSize 3. VbOLESizeAutoSize 4. VbOLESizeClip 167. Which of these is not a property of the UserControl object?

1. Ambient 2. Constituent 3. DataMembers 4. AccessKeys 168. Which of these is not a property of the UserControl object? 1. ContainedControls 2. HotTracking 3. MaskPicture 4. EventsFrozen 169. Which of these is not a method of the UserControl object? 1. PopupMenu 2. PaintPicture 3. StopAsyncRead 4. Print

Page 20 of 20

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
170. Which of these is not an event of the UserControl object? 1. AccessKeyPress 2. AsyncReadStart 3. AsyncReadComplete 4. EnterFocus 171. Which of the following is not a property of the AmbientProperties object returned by a UserControls Ambient property? 1. DisplayAsDefault 2. MessageReflect 3. DisplayName 4. MessageTarget 172. Which of the following is not a property of the Extender object returned by a UserControls Extender property? 1. DefaultHelp 2. Container 3. WhatThisHelpID 4. ToolTipText 173. To which event handler should you add code to establish default values for properties? 1. SetDefaults 2. InitializeProperties 3. LoadProperties 4. Initialize 174. What events occur in what order when a UserControl switches from design time to runtime? 1. ReadProperties, WriteProperties, Terminate 2. WriteProperties, ReadProperties, Terminate 3. WriteProperties, Terminate, ReadProperties 4. Terminate, WriteProperties, ReadProperties 175. Which of the following is not property of the UserDocument object? 1. ViewportExtent 2. ContainedControls 3. ContinuousScroll 4. Hyperlink 176. Which of these is not a method of the UserDocument object? 1. PropertyChanged 2. AsyncWrite 3. SetViewport 4. CancelAsyncRead 177. Which of these is not an event of the UserDocument object? 1. AsyncReadComplete 2. InitProperties 3. AsycReadProgress 4. ScrollDocument 178. Which of these is the first event that fires in a lifetime of a UserDocument object? 1. ReadProperties

Page 21 of 21

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
2. 3. 4. Initialize Load InitProperties

179. What is the correct order of occurance of InitProperties, Show, and EnterFocus events of the UserDocument object? 1. Show, InitProperties, EnterFocus 2. InitProperties, Show, EnterFocus 3. EnterFocus, Show, InitProperties 4. Show, EnterFocus, InitProperties 180. If the document has saved any propertys value, what event occurs instead of InitProperties? 1. RestoreProperties 2. ReadProperties 3. GetProperties 4. LoadProperties 181. Which method do you use to indicate to a UserDocument that youve modified its properties? 1. PropertyChanged 2. PropertiesModified 3. UpdateProperties 4. PropertyModified 182. What PropertyBag method do you use to load property values? 1. LoadProperties 2. ReadProperty 3. GetProperty 4. LoadDefaults

7. Error Handling

183. Which of these is not a main category of application error in Visual Basic? 1. Middle-tier errors 2. Syntax errors 3. Run-time errors 4. Logic errors 184. Where can you enable or disable auto syntax checking? 1. From the Environment page in the Project menus Options dialog 2. From the Syntax page in the Project menus Options dialog 3. 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 Basic breaks? 1. Break on All Errors 2. Break in Standard Module 3. Break in Class Module 4. Precision

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

Page 22 of 22

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
3. 4. On Error GoTo line# On Error Resume Next

187. With what statement do you cancel error handling? 1. On Error GoTo -1 2. On Error GoTo None 3. On Error Resume 0 4. On Error Resume Next 188. Which of these is not a valid form of the Resume statement? 1. Resume Label 2. Resume First 3. Resume 4. Resume line# 189. Which of these is not a valid property of the Err object? 1. HelpFile 2. LastDllError 3. Description 4. ErrorNumber 190. Which of these is not an argument you pass to the Raise method? 1. helpcontext 2. helpfile 3. errsource 4. number 191. 1. 2. 3. 4. Which statement is used to trigger an error. Load error Trigger Raise Error. Err Err.Raise

192. What form of the On Error statement would you use if you want to ignore the error raised. 1. On Error resume next 2. No On Error statement 3. On Error go to 0 4. 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)

Page 23 of 23

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
Strcmp (Str1, Str2, Comparetype) Comparing mode = 0 Binary Comparing 1 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 Basic Frm, 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 will create frx in run time. 10. Name some date function Dateadd(), Datediff(), Datepart(), Cdate() 11. what will be the result for 15/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 object Early 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.

Page 24 of 24

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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 controls if typeof currentcontrol is TextBox then end if next 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 & Public Multi 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 "<Function Name>" lib "<Lib Name>" Alias "<Alias Name>" (Arg, ..) as Return type. 29. What is MDI form? MDI Styles? We can have only one MDI form for a project. Multiple Document Interface. This form type is VBModal. 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.

Page 25 of 25

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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 zorder 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 simplify programming 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 Class Method 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.

Page 26 of 26

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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 that class. 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 to ActiveXDll? 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

Page 27 of 27

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)

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, DB Combo, 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 setting 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 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. 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 as the 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}"

Page 28 of 28

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
2. If it is with Arguments Means then Declare the Query Def qy Set 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.OpenresultSet Txt(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 using param 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 "=" , 10 If 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 RDOError X(0).Des X(1).Number 21. What is view Port? The area under which the container provides the view of the ActiveX Document is know as a view port. 22. What methods is used for DBGrid in unbound mode? AddData, EditData, Readdata, WriteData.

Page 29 of 29

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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 0 ODBC Cursor (Client side) 1 ServerSide Cursors (More Network traffic) - 2 25. Cursor management Client Batch Batch up the Multiple SQL Statements in a single string and Send them to the Server at one time. 26. What are the record set types? RdOpenFowardOnly 0 (Default used only for the read only purpose) RdOpenStatic 1 RdOpenDynamic 2 RdOpenKeySet 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 3 RdConcurBatch 4 28. What the RDO Methods and Events? Methods Events Begin Trans Validate Commit Trans Reposition Rollback Trans Error Cancel Query Complied Refresh Update Controls Update 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.

Page 30 of 30

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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 RdoParameterConstant Direction RdparamInput RdparamInputOutput RdParamOutput Name Type 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.

Page 31 of 31

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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].

Page 32 of 32

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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.

Page 33 of 33

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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 hosts the 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.

Page 34 of 34

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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.

Page 35 of 35

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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?

Page 36 of 36

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
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.

Page 37 of 37

ACTS National Resource Center, Pune Question Bank Visual Basic (VB) (Solved/Unsolved)
12. What is the use of the use of common dialog control? How many 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. dialog boxes can we

Page 38 of 38

ACTS National Resource Center, Pune Question Bank Visual 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 window b) 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.Connection Dim Rstemp As ADODB.Recordset Private Sub Form_Load() Rstemp.Activeconnection=Adoconn . . . . End sub Comment on the above code set and also give the correct code.

Page 39 of 39

Вам также может понравиться