Você está na página 1de 8

Subject: Informatics (065) Ms. Kanchan(KHMS) Visual Basic (XI+XII) Viva Question s Q1. What is interface? Ans.

Interface is the visual part through which user in teract with application. Q2. What is control? Ans. The icons with which the user interacts are called control. Q3. What are various types of control available i n VB? Ans. (A) Intrinsic control: The control that always found on toolbox. (B) Active X control: It is interactive objects that can reside on any form that sup port OCX (OLE control) controls. e.g. Some standard Active X controls are: ADO D ata Control, Data List, Common Dialog etc. (C) Insertable Objects: In this, othe r objects can be added to the toolbox such as Microsoft Excel etc. What do you u nderstand by a message and event? Event: - Refers to the occurrence of an activi ty. Message: - Is the information/request sent to the application. Q5. What are properties in VB? Ans. Properties are characteristics of an object that control its appearance and /or behavior. Q6. What is the relationship between properties , methods and events? Ans. Properties: is an object attributes, Method: as its a ction and event: as its responses. Q7. What is a container control? Ans. It is a control that can hold another control within it.e.g.Frame, PictureBox, form etc . Q8. What does following statements do in VB? Ans. Show: - Display a form that is currently not visible. This method automatically loads the form, if it is not loaded in memory already. Load: used to load a form in memory programmatically. Unload: - Used to remove a form from memory and release the memory space it was occupy, in loaded state. Hide: - Used to make a visible form invisible. The hid den form continues to reside in memory. Q9. What is the difference between SDI a nd MDI interfaces? Ans. MDI (Multiple Documents interface) allows the user to op en multiple windows at the same time. e.g. MS-Word is MDI application. SDI (Sing le Documents interface) allows the opening of single windows at any point of tim e. e.g. In window Notepad, only one data document can be opened at a time. Q10. Timer control generate just one event name it? Ans. Timer event . Q11. What is f ocus? When do GotFocus and LostFocus event occur? Ans. Focus is the ability to r eceive user input through mouse or keyboard. When an object has the focus, it ca n receive input from a user. The GotFocus event occurs when an object receive fo cus. The LostFocus event occurs when an object loses focus. Q4. Ans. Page 1 Made By Ms. Kanchan Khurana Subject: Informatics (065) Ms. Kanchan(KHMS)

Q12. What is control array? Ans. It is a group of control created on the same fo rm, having same name and type. The control in a control array is distinguished o n the basis of a property called index. Q13. Name the three file system controls ? Ans. (1) Drive List Box (2) Directory List Box (3) File List Box. Q14. Name th e control that cannot receive Focus? Ans. Frame, Image, label, Shape and Timer c ontrol. Q15. What is Data Control? Ans. A Data Control is a control used to conn ect a VB application to a database. Q16. List some important properties of a Dat a Control? Ans. Databasename, Exclusive, RecordSource, ReadOnly. Q17. Name some invisible control? Ans. Timer control, Common Dialog control, Image List. Q18. W hat is bound control? Ans. Bound control is the control that can provide access to a specific column or columns in a data source through a data control or throu gh remote data. The bound controls are CheckBox, images, Label, PictureBox, Text Box. Q19. Name three common properties of bound control? Ans. Datasource, DataFi eld and Datachange Q20. How PictureBox and Image controls are differ? Ans. Pictu reBox can also act as a container for other controls that an image control canno t do. Q21. What is a ToolBar? Ans. A ToolBar is a container for buttons that gen erally correspond to frequently used commands in an applications menu. Q22. What is a StatusBar? Ans. StatusBar is a frame that contains various panels to inform the user about the status of an application. Q23. What is a Status Bar Panel? A ns. It is a section of status bar that is used to display information about a pa rticular attribute of the application. Q24. What is Separator Bar? Ans. A bar on a menu that divides menu items into logical group is called a Separator Bar. It is used fro clarity and for dividing logically related menu items into logical groups. Q25. What are dynamic menus? Ans. Dynamic menus are menus to which menu items can be added or removed at runtime. Q26. What is OLE? Ans. OLE stands for object linking and Embedding. OLE is a way to link different applications. The a pplication whose object is placed in other application is called source document and the document where this object is placed is called the destination document . Q27. What is embedded object? Ans. Embedded object is an object in a destinati on document that is a copy of information, created in another application. Page 2 Made By Ms. Kanchan Khurana Subject: Informatics (065) Ms. Kanchan(KHMS) Q28. What for is an OLE container control used? Ans. The OLE container control e nables us to add insertable objects to the form in our VB application. Q29. What is the difference between linked and embedded object?

Ans. An embedded object is placed in the destination document in complete form a nd it become part of the destination document. A linked object, on the other han d is actually a way to establish link between source and destination document. I n this, an object is not placed in destination document; rather a link is placed here. Q30. What is a Recordset? Ans30. Recordset is a temporary table (dummy ta ble), created in main memory, by VB to hold the data generated by a data source (e.g. a data control). Q31. What do you understand by implicit and explicit decl aration? Ans31. Implicit declaration means usage of variable without declaring i t, i.e. VB implicit declares its type to be variant. Explicit declarations means all variable must be declared before using it. It can be enforced by typing Opt ion Explicit at the top of the module can enforce it. Q32. What is Modal and Mod eless Form? Ans32. Modal Form is one that takes total control of the application and does not let the user work with other application until it is closed. Model ess Form on the other hand allows the user to interact with the other applicatio n/switching to any other forms. Q33. What is ADO? Ans33. ADO expands to ActiveX Data Objects. It is an application program interface from Microsoft, which is us ed with windows applications to get access to relational as well as non-relation al database. Q34. What is OLDB? Ans34. OLEDB is a set of interfaces that provide s uniform access to data stored in diverse data stores; using OLEDB one can acce ss all types of databases in the same manner. Q35. What is Data Provider? Ans35. A data provider is a control, a set of objects or a mechanism that provides dat a to applications by connecting to a data store. Q36. What os ODBC? Ans36. ODBC (Open Database Connectivity) is an application-programming interface that enable s application to access data from a variety of existing data source. Q37. Name s ome data aware controls: -both intrinsic and ActiveX controls? Ans37. (A) Intrin sic:- TextBox, CheckBox, Label, ListBox etc. (B) ActiveX:-DataGrid, Datalist, Ms flexGrid etc. Q38. Name some major object involved in ADODB processing? Ans38. ( i) Connection object (ii)command object (iii)Recordset Q39. List any three metho ds of the connection objects? Ans39. Open, Execute, Close. Q40. List at least fo ur properties of a connection object? Ans40. (i) Connection String. (ii) Provide r (iii) Cursor Location (iv) Connection Timeout Page 3 Made By Ms. Kanchan Khura na Subject: Informatics (065) Ms. Kanchan(KHMS) Q41. What is DSN? Ans41. DSN (Data source Name) is a logical name used by ODBC t o store the information required to access a data store. A DSN once created can be used later also for accessing data from it connected data store. Q42. Which c ommand type would you specify as the data source for the following requirements? Ans42.

i. Entire table data is required: -adcmdTable. ii. A store procedure is to be ex ecuted: -adCmdStoredProc. iii. SQL command is to be executed: -adCmdText. iv. So urce of data is unknown: - adCmdUnknown. Q43. How would you obtain the no of rec ords in a ecordset? Ans43. RecordCount property of Recordset. Q44. Using what me thod SQL query can be run on connection object? Ans44. Execute. Q45. Compare Sel ection construct with iteration construct in VB? Ans45. Selection Construct Iter ation Construct 1. These construct are used for branching the control flow depen ding upon a certain conditions. 1.These constructs are used fo rrepeating a set of statements depending upon a certain conditions. 2. Selection construct availa ble in VB are IF,IF---else, nested IF, Select Case etc. 2. Iteration construct a vailable in VB are For---Next,Dowhile,Loop Q46. Discuss various Loop-Types in VB with example? Ans46. VB supports two basic loop-types:(i) Entry-Controlled/Pre-T ested/Top-Tested Loop:These loops are first tested for execution before the loop body executes. e.g. Do While--Loop, For--- Next,While---Wend. (ii) Exit-Control led/Post-Tested/Bottom-Tested Loop:are the ones which are tested for execution a fter the loop body executes. e.g. Do Loop until, Do---Loop while. Q47. What is a procedure? Ans47. A procedure is a named unit of a group of program statements t hat perform a well-defined task. It can be invoked other parts of the program. I n other words a procedure is a named code block that is created to do a well-def ined task. Q48. How many types of procedure are available in VB? Ans48. There ar e several types of procedure are available in VB:(i) Sub-Procedure: - is a proce dure that performs a task but does not return a value. (ii) Event-Procedure: - i s a sub-procedure associated with a specific event of an object. It gets invoked when specific event occurs for its object. E.g. Cmd_ok click () (iii) PropertyProcedure: - are the procedures used for reading/setting of an objects property v alue. Page 4 Made By Ms. Kanchan Khurana Subject: Informatics (065) Ms. Kanchan(KHMS) (iv) General-Procedure: - is a procedure written by a programmer to solve an app lication specific problem. It is invoked when a call statement is executed for i t. Q49. What are actual and formal parameters? Ans49. Actual parameters are thos e, which appear in the statement invoking the procedure function where as formal parameters are those which appear in the definition of the procedure function. Q50. What do you mean by scope of a variable? Ans50. The scope or visibility of a variable is the portion of code from which that variable can be accessed. Q51. What do you mean by lifetime of a variable? Ans51. It is the time period during which that variable stays alive and

occupies memory. Q52. How many types of scopes are supported in VB? Ans52. (i) L ocal Scope: - Variable can only be used in procedure/function in which it is def ined. (ii)Global Scope: - Variable can be used globally I.e. throughout the appl ication. (iii)Module Scope: - Variable can be used in all procedure/function def ined in the module which contains the definition for the variable. Q53. What are various advantages of using procedure in VB application? Ans53. (i) Reduction i n size of source code. (ii) Reduction in size of compiled code. (iii) Program be comes more maintainable. (iv) Logic becomes more understandable. Q54. Differenti ate between following: Ans54.(A) Private/Local Variables and Public/Global Varia ble Private/Local Variables Public/Global Variable (1) These variable are usable and available only from the code within their own procedure. (1) These variable are usable and available in all procedure within an application. (2) They lose their value as soon as the execution of their parent is over. They retain their value throughout an application. (B) Private/Local Procedure and Public/Global P rocedure Private/Local Procedure Public/Global Procedure (1) These procedure are usable and available only from the code within their own module (1) These proce dure are usable and available in all modules within an application. (C ) Local V ariable and Stacic Variable Local Variable Static Variable (1) They lose their v alue as soon as execution of their parent is over (1) They retain their value ev en after their parent procedure is over (2) Their lifetime is function/procedure run. (2) Their lifetime is application run Page 5 Made By Ms. Kanchan Khurana S ubject: Informatics (065) Ms. Kanchan(KHMS) Q55. Name two ways in which arguments can be passed to procedures? Ans55. (1) By value (ii) By Reference Q56. How is pass by value is different from pass by ref erence in terms of variable passed? Ans56. Pass by value Pass by reference (1) A copy of actual parameters is passed to the called procedure. (i) Reference to t he actual parameters is passed to the calling procedure. (2) The original conten t of the passed variable (actual parameters) are not affected by the called proc edure/function. (2) The original content of the passed variable (actual paramete rs) are affected by the changes made in the called procedure/function. Q57. What do you understand by parameters or arguments? Ans57. A parameters or an argumen t is the data passed from a calling program to the called program.

Q58. What do you understand by optional arguments? Ans58. An optional arguments is the one to which the calling program might or might not pass a value while in voking a function/procedure. Q59. How is event procedure different from general procedure? Ans59. Event procedure is invoked by the runtime, in response to a us er action or some internal activity. General procedure on the other hand needs t o be invoked explicitly by the programmer. Q60. What is a function? Ans60. A fun ction is a named block of code, which apart from doing a welldefined task, retur n some calculated value to the calling program/procedure. Q61. How is function s imilar to and different from a procedure? Ans61. Both function and procedure are general procedure that perform a specific task, can take arguments, perform a s eries of statements and change the value of its arguments. A function however, c an return a value to the calling procedure whereas a sub-procedure cannot return any value. Q62. What is module? Ans62. A module is a container of many declarat ions and code. Q63. What types of modules are available in VB? Ans63. There are three types of modules are available in VB (i) Form Module: a) All the form that are added to a VB application are example of from module. b) These module have two types of views(design and code view) c) These modules are saved with extensi on .frm. (ii) Standard Modules: a) Module that has no user interface and is used to group certain procedure or declaration are called standard module. b) These module store general purpose code of application i.e. that are not specific to o ne single form of the application. Page 6 Made By Ms. Kanchan Khurana (iii) Class Modules: a) A module that is used to create a user-defined data-type that can have properties, vents, general procedure etc. associated with it. b) Class module is stored with extension .cls. Q64. What are library/Built in funct ion? Ans64. Functions that are predefined and already available in VB are called library/built-in function. Q65. What are various built-in-function in VB? Ans65. (I) String Function (II) Numeric Function (III) Date/Time function Q66. Explain various String-Function with example? Ans66. Functions Description 1. Lcase(STUD ENT)=student Description:- (convert given string into lowercase letters) 2. Ucase (student)=STUDENT Description:- (convert given string into uppercase letters) 3. L en(STUDENT)=7 Description:-(Find length of given string) 4. Ltrim($$$student)=studen t Description:- (Remove spaces from left side of given string) 5. rtrim(student$$ $$)=student Description:-(Remove spaces from right side of given string) 6. Trim($ $student$$$)=student

Description:- (Remove spaces from both side of given string) 7. Left(VIDU PRIYA S HARMA,5)=VIDU Description:- (Extract 5 leftmost character from given string) 8. R ight(VIDU PRIYA SHARMA,6)=SHARMA Description:- (Extract 6 rightmost character from given string) 9. Mid(VIDU PRIYA SHARMA,3,6)=DU PRI Description:- (Extract charact ers starting from 3 postion to 6th position character from given string) Mid sta tement is also replace extract characters with text you specify e.g. Sinput=VIDU $ SHARMA Mid(sinput,5,1)=- Ans=VIDU-SHARMA. In this example $ replace with - characte r at 5th postion 10. Instr(4,INFORMATICS,s,1)=11 Description:- (Searched character s in given string starting searching from 4th character onwards by ignoring case) 11. Instr(2,INFORMATICS,s,0)=0 Description:- (Searched character s in given string starting searching from 2nd character onwards by considering case) If Last argum ent in INSTR( ) is mission that is 1 or 0 then it is zero by default. 12. String (5,*)=***** Description:- (Print given character given no of times) 13. String(4,AB C)=AAAA Description:- (Print first character given no of times from a string) 14. String(6,66)=BBBBBB Description:-(Print character B(because ASCII value of B is 66 given no of times) Page 7 Made By Ms. Kanchan Khurana 15. STR(1302)=1302 Descr iption:-(Convert a number into string) 16. StrReverse(ANITA SHARMA)=ATINA AMRAHS Description:-(Reverse the given string) 17. CHR(65)=A CHR(97)=a Description:-(Re turn a string conating the charcter associated with specified character code) 18 . ASC(AMAR)=65 ASC(delhi)=100 Description:-(Return a ASCII value of first character of a given string)

Você também pode gostar