You create a Visual Basic application that uses the Microsoft Internet Explorer object model. You include the following code in the General Declarations sections of a form-level module: Private oIE As new Internet Explorer.When will Visual Basic instantiate this object? A. When the form is loaded. B. When the form is displayed on the screen. C. When the declaration is executed. D. When the object is first referenced in your code.
Answer: D.
You are asked to use Visual Basic to create a Human Resources application that will maintain, among other things, employee information. In designing application, you delete to encapsulate the business logic into a COM EXE named HRManager.exe. Within the user interface portion of your application, you want to create an instance of the Employee object exposed by HRManager.exe Which two code fragments will instantiate an Employee object variable? (Choose two) A. Set oEmployee = New HRManager.Employee
Answer: A, B.
You create a multi-user Visual Basic application that interacts with a database. You are using ADO and need an updatable, disconnected recordset. You need to offer users the ability to add, update, and modify records. What must you do to accomplish this? A. Set the CursorType property to adOpenStatic, and set the LockType property to adLockBatchOptimistic. B. Set the CursorType property to adOpenDynamic, and set the LockType property to adLockPessimitic. C. Set the CurcorType property to adOpenDynamic
Answer: A.
You are using Visual Basic to create an ActiveX control that will provide a banner at the top of the container in which it is placed. When the developer adds your control to a container, you want to set the caption displayed in the lblCaption constituent control to match the name assigned to the control itself. Which code fragment should you use? A. Private Sub UserControl_InitProperties ()On Error Resume Next LblCaption.Caption = Extender.NameEnd Sub B. Private Sub UserControl_AmbientChanged (
Answer: A.
You are using Visual Basic to create an ActiveX control that you want to distribute to other developers. You want to add an About box to your control to show your e-mail address. How can you implement this About box so that it is available in the Properties Window?A. Add a new property page to your control project. Name this page in the Connect Property Pages dialog box. B. Add a new form to your control project. Create a public procedure to show the form, and set its procedure ID to About Box.
Answer: B.
You are working on a Visual Basic application that displays summary information about files on your computer. This application is split into a COM server and a COM client, both written in Visual Basic. After compiling both the server and the client, you discover an error in your server code. You correct the error and recompile the server. When you run the client, you receive an error message stating; "Class does not support Automation or does not support expected interface." Which two
Answer: B, C.
Your Visual Basic application uses a middle-tier business object to store inventory information in a database. The middle-tier object can be created on the same computer as the calling program, or on a remote computer by using DCOM. One of the business rules implemented by this object is that the inventory for an item can never be negative. How should the object inform the user interface when this business rule is broken?A. By using the MsgBox function to show a message to the user. B. By using
Answer: B.
You are using Visual Basic to create a COM DLL. This COM DLL provides customer information to other applications for your company. The COM DLL exposes a customer object with properties representing all information that is needed by these other applications. Internally, your COM DLL uses an object named Row to retrieve customer information from a Microsoft SQL Server database. For increased speed in data access, your customer object exposes a property named Bookmark that can hold a recordset bookmark.
Answer: C.
You are helping to convert an application from Visual Basic forms to Active Documents so that it can be used in web browsers on the corporate intranet. You are revising code in docCustomer, an active document created from the frmCustomer form. The current code is as follows: Private Sub cmdInventory_Click() FrmInventory.Show End Sub The frminventory form has been converted to become the docinventory active document. Which procedure should you use to best preserve the functionality of
Answer: C.
You create a Visual Basic application that uses conditional compilation to enable and disable elements of functionality. Which two mechanisms can you use to set conditional compilation constants? (Choose two) A. The dim statement. B. The const statement. C. The #const directive. D. The project properties dialog box. E. The project reference dialog box.
Answer: C, D.