VB6 desktop exam questions And Answers 1. You have a component - TopicsExpress



          

VB6 desktop exam questions And Answers 1. You have a component which verifies the pwd what will be used DLL,EXE or (also An user enters an ip address in the format nnn.nnn.nnn. Validate the password.) Ans. Activex Control 2. How to add a component to a project from Visual Comp Manager. Ans. Click the component and select add to the project from the short cut menu. 3. Asynchronous processing Ans. Dim with events. 4. Your popup menu should be visible after it is selected Ans. 1. Create a top level menu with the menu items you want to display 2. make the top level menu invisible by clearing the Visible check box in the menu editor. 3. in the mouse up event of the form, determine whether the user clicked the right mouse button ( If button=vbrightbutton then Frmmain.popupmenu mnufilepop Endif 5. Unbound textbox Ans. Set Textbox.Datasouce = Adodc Textbox.Datafield = “field name” 6. How do u register a Com DLL Ans. Compile the component Regserver 32.exe Create a setup program. 7. In a user control you want to add an about box Ans. Go to tools menu, go to Procedure attributes & click the advanced Tab , set the procedure ID to about box 8. Sort Operation in a listview control Ans. .Sortkey = “column headers.Index – 1 then If .Sortorder = LVWacending then .Sortorder = LVW Descending else .Sortorder = LVW Ascending 9. Conditional Compilation Ans. #const, in the Project properties Dialogbox, make tab, specify conditional Compilation arguments 10. In a text box only numeric entries should be allowed. In which event will you check. Ans. Keypress. 11. U have an app which is connected to the database. The user should exit the app only by pressing QUIT button(code here disconnects the app from the Database ) Ans. Query unload. 12. You migrate an Exe project which has code to show a form to an Activex Doc. What changes will you make to show the form (form.show doesn’t work with documents) Ans: Userdoc1.hyperlink.navigate to “ trial.vbd” 13. U have an app which has business rules. If any changes are made to the rules the app should not be changed. Ans. Put all these business rules in a Com server. 14. U already have a control, u want to give users the right to use them, then U change the version and u want only authorized users to use it. What do U Do? Ans. License file along with this. 15. In a Lan based environment how do u deploy? Ans. Put it on a server in the network. 16. An app is a flat file they are changing to Sql server What should U do? Ans. Put your data access in a COM component. After the changes is made Change the component and rebuid using P & D wizard. 17. U have a list box with 3 items in design time. U ad 3 items to the listbox during run time in the form_initialise event. What happens when we load it and each time the form is shown. Ans. Only once 18. U are changing something that is already deployed. Where do u make the changes . 19. When is the form instantiated Ans. Set x = new connection Create object. 20.U have already packaged an App. They are similar to the previous one. Where do u go to see the changes? 21 You want to debug a VB Application using VC++. What option would you check in the optimization dialog box? Ans. Create symbolic debug info, Native code also. 22 You are using a third party control in an app that is deployed. Later on you find that a new version of the control is available. How do you deploy a new version? Ans. Package it into OCX and deploy. 23 A number of users are developing an app; You make changes to your module You want to make sure that the users get the latest version. How do you do it? Ans. Get the latest version from the VSS, test it with the other modules; if it works fine, then check in. 24 Suppose u’ve an app which is already pkged and u want to package another one similar to it? Ans. Create the copy of old script file and use a copied script package. 25 The customer currently uses a flat file legacy database. Within 18 moths the customer will be moving all of their legacy data to relational database in MSSQL . The application needs to be implement prior to the data conversion. Ans :Implement a set of COM component to handle all access to the legacy data. When the conversion to SQL server takes place, these COM components can be replaced with new versions that interact with the SQL server. 26 You are designing a VB desktop application that will be used to diagnose information. You have developed a logical design that identifies data services, business services and user services. 27 You are using VB class module to modularize the VB application. You expect this application to be used by a wide variety of users including School children, University students, Business users and users with Visual or hearing Impairments. How should you design your application. Ans Create separate user services for each of these users and use the same buiness services and data services. 28.Your Application uses Ado to interact with a relational database. Users require the ability to update all browse records. U have an existing Connectionobject named CnDevserver and a recordset object named rscustomers. U want to create a RS rscustomers. Which code format should you use? rscustomers.open “select * from tbl customers”,CnDevserver,adopendynamic. 29 You use VB to create COM DLL project named XYZ. In this project two class modules named Student and Course. The Student class module has a method named GetID. Instances of the class need to call the GetID method. However you do not want any code outside of the project to be able call the GetID method. How should you declare GetID? ANS : Friend Function GetID() as long 30You are debugging an application, VB is in break mode at the following line of code. Llocal = Gglobal + Mlngmodule Local variable llocal is declared in the current procedure, Gglobal is a public variable, and module variable Mlngmodule is declared in the current module. How can you view the values of each of the new variable(choose two) Open the local window and expand the tree Execute Debug.print statements in the immediate window 31You are using VB to test a procedure named Test1, which is local in Module1. In the add watch dialog box, you create a new watch expression and set the Watch type to break mode value is true. You want the watch expression to be active only when code is running in the Test1 procedure, which setting you specify for the procedure contest and the module context of the watch expression. Set the Procedure Context to Test1, and set the module context to Module1. 32 You create an ActiveX control named MyCalender. You need to debug your control within Vbhost application named Calender test which u have created earlier. U want to debug both MyCalender and its interaction with Calender test. Enter Calender test.exe in the start program box and click O.K Click cancel. Add the Calender test application to the project group and make it start up 33 You have VB application in which you want to involve your own error handler. You create variables to hold the values needed to display your own error message. Which code argument will invoke your error? Err.Raise Number := VbobjectError+intcustom, Source := strErrsource, Description := strErrdescription, Helpfile := Strhelpfile, Helpcontext := Concontext 34 You create a VB application named Myapplication that will access data from a Microsoft SQL server DB named MyDataBase. You want to install your application on 1000 networked client computers. You want to allow your application to connect to the SQL Server from each of the clients by using ODBC.What must you do to accomplish this? On each client computer, install the SQL server ODBC driver and configure an ODBC DSN for user by your application. 35 You create a VB application that will asynchronously communicate with a set of out of process Com components by using its own object to them. This application will supply the user interface for the entire group of components by displaying a form named frm mform. You have already set frm mform as the startup object for your application, which project properties must you set to ensure that frm mform will be shown. When the application is started. 36 Use ADODC in pre-existing application. You develops to use it in their new data access application . You also have a login from in it. 37 Using toolbar control use which type select case statement Select Case Button.key Note: .key and .index are correct. But exam is looking for .ky as correct, because the index may change if U add buttons in run time 38Adding help information for a class Ans. Using project propertites 39.Error handlers are written in almost all procedures and I want to trap all errors that may occur. Ans :Break on unhandled errors. 40.A multiservice component services are implemented as different class. Service objects can be used by the clients but should not create Ans. Set the instancing property to Public not creatable. 41. Create a VB activeX.EXE , you want to distribute in your webpage. Your control automatically installs from your webpage. Ans. Use P&D wizard to package into a single cab,digitally sign it and transfer to your web site using FTP. 42. U use VB to create a Custom Activex Control that will be used throughout your company. Your company used VCM to share between developers. How can you make your new control available in VCM? Ans.add to project from shortcut 43.Menu control should display checked ---. How to toggle it? Ans. mnuoption.checked = not mnuoption.checked. 44. You can add descriptive text and context sensitive help for each of the properties, methods and events in a class. To give description Ans: open the project containing the class module, open the code window for the class module , on the tools menu click procedure attributs. Fill in the description and help contextID for each procedure 45.When establishing a connection you have to inform the user the success or Failure of the operation. In which event will you write the code. Ans.Connectcomplete. 46. You need to be able to see changes to the data in the recordset but do not need to see additions or deletions of recordset ans : adopenkeyset 47. . How to set the component options for a pgm that used floating pt calculations, but the pgm never compared two fl.pt values. Ans : allow unrounded FPO 48. a form with ctrl array with 2 option ctrls in a frame and a command button. Select the event to catch a click on option ctrl so that the command button disabled. Ans : click event in array option control 49. one lengthy question about calculating salary. There is an error in it so the message displayed will be “error has occurred “ from the error handler. 50. How do you test an ActiveX document in developer machine? Ans: Unregister and rename all the references and then test it. Good Luck!
Posted on: Sat, 17 Aug 2013 16:24:34 +0000

Trending Topics



Recently Viewed Topics




© 2015