EasyInterview

Sunday, July 27, 2008

vbquestions

VB Questions (General)

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?

The Variant data type has a numeric storage size of 16 bytes and can contain data up to the range of a Decimal, or a character storage size of 22 bytes (plus string length), and can store any character text.


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)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 BasicFrm, bas, cls, res, vbx, ocx, frx, vbp, exe
9. What is frx?When some controls like grid and third party control placed in our application then it will create frx in run time.
10. Name some date functionDateadd(), 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?) Function will return value but sub procedure wont return values…


14. Where will we give the option explicit keyword and for what?
In the general declarations section. To trap undeclared variables.
15. What is Friend Variable?Scope sharable between projects.
16. What is binding? What are types of binding?Assigning variable with defined memory space. Late Binding - Memory size is allotted in later stage.Ex: - Dim x as objectEarly Binding - Memory size is allotted while declaring itself.New Key word is important.Ex: - Dim x as New Object
17. What is the difference between Property Get, Set and Let.Set – Value is assigned to ActiveX Object from the form.Let – Value is retried to ActiveX Object from the form.
Get- Assigns the value of an expression to a variable or property.
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 types 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)
VB Questions (Client Server)
1. What is difference between datagrid and flexgrid?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 databases. I.e., It is encapsulation of DAO, RDO, and 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?3. 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 Attributes.DbRelationDeleteCascade,DbRelationUpdateCascade.
7. What are the locks available in Visual Basic? Locking is the process by which a DBMS restricts access to a row in a multi-user environment
4 types of locks. They are
1. Batch Optimistic
2. Optimistic
3. Pessimistic
4. ReadOnly
Operations in a relational database act on a complete set of rows. The set of rows returned by a SELECT statement consists of all the rows that satisfy the conditions in the WHERE clause of the statement. This complete set of rows returned by the statement is known as the result set. Applications, especially those that are interactive and online, cannot always work effectively with the entire result set as a unit. These applications need a mechanism to work with one row or a small block of rows at a time. Cursors are an extension to result sets that provide that mechanism.

Cursor or lock type
Advantages
Disadvantages
AdOpenForwardOnly (Default)
· Low resource requirements
· Cannot scroll backward
· No data concurrency
AdOpenStatic
· Scrollable (Wont detect changes made at the same time by another application)
· No data concurrency
AdOpenKeyset
· Some data concurrency
· Scrollable
· Higher resource requirements
· Not available in disconnected scenario
AdOpenDynamic
· High data concurrency
· Scrollable
· Highest resource requirements
· Not available in disconnected scenario
AdLockReadOnly
· Low resource requirements
· Highly scalable
· Data not updatable through cursor
AdLockBatchOptimistic
· Batch updates
· Allows disconnected scenarios
· Other users able to access data
· Data can be changed by multiple users at once
AdLockPessimistic
· Data cannot be changed by other users while locked
· Prevents other users from accessing data while locked
AdLockOptimistic
· Other users able to access data
· Data can be changed by multiple users at once


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.
7. 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.
8. 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.
9. What are the Technologies for Accessing Database from Visual Basic?DAO, Data Control, RDO, ODBCDIRECT, ADO, ODBC API , 0040.
10. Calling Stored Procedures in VB?1. Calling Simply the Procedure with out Arguments"Call ProcedureName}"2. If it is with Arguments Means thenDeclare the Query Def qySet Qy as New Query defQy.SQL = "{Call ProcedureName(?,?,?)}" qy(0)=val(Txt1.Text) qy(1)=val(Txt2.Text) qy(2)=val(Txt3.Text) Set Rs = Qy.OpenresultSetTxt(1)=Rs.RdoColumns(0)
11. What is MAPI ?Messaging Application programing Interface.
12. 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.
13. What are the different types of error?Syntax Errors, Runtime , Logic.
14. What is Seek Method which type of record set is available this?Only in DbOpenTables.Syntax: rs.index = "empno"rs.seek "=" , 10If with our setting the rs.index then run time error will occur.
15. What is Centralization Error Handling?Writing funciton and calling it when error occurs.
16. Handling Error in Calling chain.This will call the top most error where the error is handled.
17. To connect the Data Control with Back end What are all the properties to be set?Data source Name, Record Source Name
18. How to trap Data Base Error?Dim x as RDOErrorX(0).DesX(1).Number
19. What is view Port?The area under which the container provides the view of the ActiveX Document is known as a view port.
20. What methods are used for DBGrid in unbound mode?AddData, EditData, Readdata, WriteData.
21. 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.
22. Setting the Cursors.Default Cursor – 0ODBC Cursor (Client side) – 1ServerSide Cursors (More Network traffic) - 2
23. Cursor management Client Batch – Batch up the Multiple SQL Statements in a single string and Send them to the Server at one time.
24. What are the record set types?RdOpenFowardOnly 0 (Default used only for the read only purpose)RdOpenStatic 1RdOpenDynamic 2RdOpenKeySet 3 (Normally used for the live project)
25. Diff types of Lock Types?RdConcurReadOnly 0 (Default)RdConcurLock 1 (Pessimistic Locking)RdConcurRowver 2 (Optimistic Lociking)RdConcurValues 3RdConcurBatch 4
26. What the RDO Methods and Events?Methods EventsBegin Trans ValidateCommit Trans RepositionRollback Trans ErrorCancel Query CompliedRefresh Update ControlsUpdate row
27. What is Static Cursor?In ADO Snap Shot is called so.
28. What is Mixed Cursors?Static + Keyset
29. What is FireHouse Cursors?Forward Only Some time Updateable
30. What is DBSqlPassThrough?It will By Passing the Jet Query Processor.
31. What is DBFailError?Rolls Back updates if any errors Occurs.
32. DSN Less Connection?"Server=Oracle; Driver={Microsoft ODBC for Oracle};"
33. What is RdExecDirect?Bypasses the Creation of a stored procedure to execute the query. Does not apply to Oracle.
34. RdoParameter Object RdoParameterConstantDirection RdparamInputRdparamInputOutputRdParamOutputNameTypeValue
.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home