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?

    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)
    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.


  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.

  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 photo’s 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 z-order 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.

  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