Vb Questions

download Vb Questions

of 30

Transcript of Vb Questions

  • 8/14/2019 Vb Questions

    1/30

    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 16bytes and can contain data up to the range of aDecimal, or a character storage size of 22 bytes (plusstring 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 Comparing1 Textual Comparing

    4. What is the max size allowed for Msgbox Prompt andInput 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 controlplaced in our application then it will create frx inrun time.

    10. Name some date function

    Dateadd(), Datediff(), Datepart(), Cdate()

    11. what will be the result for

  • 8/14/2019 Vb Questions

    2/30

    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 a sub procedurewont return values

    14. Where will we give the option explicit keyword andfor what?

    In the general declarations section. To trapundeclared 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 whiledeclaring itself.New Key word is important.Ex:- Dim x as New Object

    17. What is the difference between Property Get, Setand Let.

    Set Value is assigned to ActiveX Object from theform.Let Value is retried to ActiveX Object from theform.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 formatteddata output.

    19. Drag and Drop state numbers and functions.

  • 8/14/2019 Vb Questions

    3/30

    State 0 Source control is being dragged with therange 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 boxcontrol are typed or not? How?

    For each currentcontrol in controlsif 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 itwith in the form?

    Group of control share the same name. Max 32, 767.

    24. What is the default model of the form? And what isit number?

    VbModaless 0 (Zero) We can able to place anotherwindow above this form.25. Suppose from form1 to form2 object propertysettings 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 outthe all project only thing is we want to set the typelib. Class Modules can be Instantiated.

    27. Different type of Instantiation?

    Private Only for the Specific Module.Public not creatable Private & PublicMulti Use - Variable we have to declare.Single Use Not possible through dll.Global Multiuse Have variable not Required toDeclare.Global Single Use - Only for exe.

  • 8/14/2019 Vb Questions

    4/30

    28. How to declare Dll Procedure?Declare function "" lib ""Alias "" (Arg, ..) as Return type.

    1. What is MDI form? MDI Styles?

    We can have only one MDI form for a project. MultipleDocument Interface. This form type is VBModal. We haveset the Child property of the forms to True to placeforms inside this MDI.Style availables 1. VbCascade 2. VbTitle Horizontal

    2. How many images can be placed in the image list ?

    643. What is Inprocess and Out of Process?

    Inprocess It will run with in the memory. ( LocalMachine).

    Out of Process It will run out of the memoryNormally in the server side.

    4. Diff type of Datatypes?

    LOB (Large Object Data type).CLOB (Stores Character Objects).BLOB ( Store Binary Objects such as Graphic, VideoChips and Sound files).BFILE(Store file pointers to LOB It may Containfilename for photos store on CD_ROM).

    5. What is Zorder Method?

    Object.Zorder = 1 or 0 Place a Specified mdiform formor control at the front or back of the z-order with nits Graphical Level.6. What is diff between the Generic Variable andSpecific Variable?

    Generic Variable:

    Create Object Ex:-Ole-Automation . No need refer theobject library.

    Specific Variable:

    Binding Procedure Early and Late Binding ( Can beRemove from the Memory).7. What are properties available in Clip Board?

    No Properties Available. Only the methods they areSetText, GetText, Setdata(), Getformat(), Clear.

    8. What is Dll?

    Libraries of procedure external to the application but

  • 8/14/2019 Vb Questions

    5/30

    can be called from the application.

    9. What is Tabstrip control? What is the startingIndex value? How to locate it?

    It is tab control to place our controls with in theform in multiple sheets.Index starts with 1. And to identify

    If Tabstrip1.SelectedItem.Index = 1 Then..End if

    10. Why we use Treeview Control?

    To list the hierarchial list of the node objects. Suchof files and Directories.

    11. Why we need OLE-Automation?Advantages?

    Enables an application to exposes objects and methodsto 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).

    12. What is the diff between the Create Object and Getobject?

    Create Object - To create an instance of an object.Get Object To get the reference to an existingobject.

    13. Have you create Properties and Methods for yourown Controls?

    Properties Public variable of a ClassMethod Public procedure of a class

    14. What is Collection Objects?

    Similarly to arrays but is preferred over an arraybecause of the following reasons.

    1. A collection objects uses less Memory than anarray.2. It provides methods to add and delete members.

    3. It does not required reason statement when objectsare added or deleted.4. It does not have boundary limitations.

    15. What is Static Variable?

    Its Scope will be available through out the life time.

    16. Private Dim x as integer.

  • 8/14/2019 Vb Questions

    6/30

    Private cannot be used in front of DIM.

    17. What is Implicit?

    Instance of specific copy of a class with its ownsettings for the properties defined in that class.Note: The implicity defined variable is never equal tonothing.

    18. What are the scope of the class?

    Public , private, Friend

    19. Can we able to set Instancing properties likeSingleuse, GlobalSingleuse to ActiveXDll?

    No.

    20. In project properties if we set Unattended what isit mean?

    This cannot have user interface. This can be used forthe COM creation.

    21. What are the Style Properties of Combo Box?

    Simple, Dropdown list We can type and select.Dropdown Combo Only Drop Down.

    22. What are the Style properties of List Box?

    Simple Single Select , Extended. Multiple Select.

    23. What are the different types of Dialog Box?

    Predefined, Custom, User Defined.

    24. What is Parser Bug?

    It is difficult to use database objects declared in amodule from within a form.

    25. What is the Dll required for running the VB?

    Vbrun300.dll

    26. Can We create CGI scripts in VB?

    Yes.

    27. How to change the Mouse Pointer?

    Screen.MousePointer = VBHourGlass/VBNormal.

    28. How to check the condition in Msgbox?

    If(Msgbox("Do you want to delete this

  • 8/14/2019 Vb Questions

    7/30

    Record",VbYesNo)=VbYes)Then End if

    VB Questions (Client Server)1. What is difference between datagrid and flexgrid?

    Datagrid Editable.Flexigrid Non-Editable. (Generally used for Readonly purpose.)

    2. What is ADO? What are its objects ?

    ActiveX Data Object. ADO can access data from bothflat files as well as the databases. I.e., It isencapsulation of DAO, RDO, and OLE that is why we callit 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 databaseEngine).

    Cascade Delete, Cascade Update is done settingproperty of Attributes.DbRelationDeleteCascade,DbRelationUpdateCascade.

    7. What are the locks available in VisualBasic?

    Locking is the process by which a DBMSrestricts access to a row in a multi-user environment

    4 types of locks. They are

    1. Batch Optimistic2. Optimistic3. Pessimistic4. ReadOnly

    Operations in a relational database act on a completeset of rows. The set of rows returned by a SELECTstatement consists of all the rows that satisfy theconditions in the WHERE clause of the statement. Thiscomplete set of rows returned by the statement is

  • 8/14/2019 Vb Questions

    8/30

    known as the result set. Applications, especiallythose that are interactive and online, cannot alwayswork effectively with the entire result set as a unit.These applications need a mechanism to work with onerow or a small block of rows at a time. Cursors are anextension to result sets that provide that mechanism.

    Cursor or lock type Advantages DisadvantagesAdOpenForwardOnly (Default) Low resourcerequirements Cannot scroll backward No dataconcurrencyAdOpenStatic Scrollable (Wont detect changes made atthe same time by another application) No dataconcurrencyAdOpenKeyset Some data concurrency Scrollable Higher resource requirements Not available indisconnected scenarioAdOpenDynamic High data concurrency Scrollable

    Highest resource requirements Not available indisconnected scenarioAdLockReadOnly Low resource requirements Highlyscalable Data not updatable through cursorAdLockBatchOptimistic Batch updates Allowsdisconnected scenarios Other users able to accessdata Data can be changed by multiple users at onceAdLockPessimistic Data cannot be changed by otherusers while locked Prevents other users fromaccessing data while lockedAdLockOptimistic 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 Objectmodel. ADO can access data from both flat files aswell as the data bases. I.e., It is encapsulation ofDAO, RDO , OLE that is why we call it as OLE-DBTechnology.

    7. How can we call Stored procedure of Back End in RDOand 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 Driverand Oracle OBDC Driver?

    Microsoft ODBC driver will support all the methods andproperties of Visual Basic. Where as the Oracle not.

    9. What are the Technologies for Accessing Databasefrom Visual Basic?

  • 8/14/2019 Vb Questions

    9/30

    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 then

    Declare 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 declaringarguments 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 isavailable this?

    Only in DbOpenTables.Syntax: rs.index = "empno"rs.seek "=" , 10If with our setting the rs.index then run time errorwill 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 ishandled.

    17. To connect the Data Control with Back end What areall the properties to be set?

  • 8/14/2019 Vb Questions

    10/30

    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 viewof 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 withmonth,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 ina single string and Send them to the Server at onetime.

    24. What are the record set types?

    RdOpenFowardOnly 0 (Default used only for the readonly 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 Events

  • 8/14/2019 Vb Questions

    11/30

    Begin Trans ValidateCommit Trans RepositionRollback Trans ErrorCancel Query CompliedRefreshUpdate 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 executethe query. Does not apply to Oracle.

    34. RdoParameter Object RdoParameterConstant

    Direction RdparamInputRdparamInputOutputRdParamOutputNameTypeValue.

    ***************************************************************************************

    ASP 1.

    a = 1

  • 8/14/2019 Vb Questions

    12/30

    a = 2

    In the sample code shown above, what will be writtento thescreen?A. 1B. 2C. 1, 2D. 1&2E. Nothing.

    2.

    The above code appears in the global.asa file. Whatwould itaccomplish?

    A. It would create a "Thing" object and place it inContents Collection of

    the Application object.B. It would create a "Thing" object and place it inStaticObjects

    Collection of the Application object.C. It would create a "Thing" object and place it inthe Application.Buffer

    Collection Of the Application object.D. It would create an application-level variable named"Thing" with the

    value of the object property "THINGDOER.thingy".E. It would fail to create a "Thing" object becausethe code requires the

    Application.Lock and Application.Unlock methods.3.

    Referring to the above, what is the value of iPos?

    A. 0B. 1C. 2D. 8

    E. 9

    4. In the database table, if the datatype for field1(shownabove) is Number, what is the value of varType?

    A. The field value.B. A string description.C. The field name.

  • 8/14/2019 Vb Questions

    13/30

    D. NULL.E. An enumerator.

    5. What is the program ID (ProgID) for ActiveX DataObjects in 2-tier and 3-tier database applications?

    A. ADOB. RDODBC. ADODBD. RDSE. OLEDB

    6. Which choice is NOT an ADO collection?

    A. PropertiesB. RecordsC. FieldsD. ErrorsE. Parameters

    7. Which will NOT set the scope of an Active ServerComponent?

    A. Setting the [component name].scope property.B. Using the Server.CreateObject method.C. Placing it in the Session or Application OnStartevent handler.D. Instantiating the component in the global.asa file.E. Using the tag.

    8. How to handle Error in ASP

    A. Using On Error Goto B. Using On Error ResumeC. Using On Error Resume NextD. Using On Error Goto 0

    9.

    What would be the result of the above code?

    A. Type mismatch error

    B. "Hello World, Hello World, Hello World"C. 0D. "Hello World 3"E. "Hello World"

    10. What happens when a client submits a form whichchanges thevalue of an Application variable?

    A. Client actions cannot change Application variables.

  • 8/14/2019 Vb Questions

    14/30

    B. The change is not visible to any client until theapplication is stoppedand started.C. The change is only visible to future requests madeby thatclient during their current session.D. The change is visible to all clients, but onlyafter theycomplete their current sessions and begin a newsession.E. The change is visible to all clients immediatelyafter theform is processed by the server.

    11. ADO is an object model for accessing which of thefollowing?

    A. Relational data via Jet.B. Local or SQL data via Jet.C. Relational data via ODBC.

    D. Non-relational data via DSN-less ODBC.E. All types of data via OLE DB.

    12. Which of the following are Server Object methods (Choose Two)A. HTMLEncode,MapPathB. URLEncode,ScriptTimeoutC. URLEncode,CreateObjectD. ScriptTimeout,Abandon

    13. Following is the code Server.MapPath (".")consider the path isC:\Inetpub\WWWRoot\MAT\Default.asp. What will be theoutput

    A. C:\InetPUbB. C:\InetPUb\WWWrootC. C:\InetPUb\wwwroot\MATD. Error

    14. ClientCertificate is a collection of

    A. ServerB. ResponseC. RequestD. ObjectContext

    15. IsClientConnected is a property of

    A. ServerB. ResponseC. RequestD. Sesssion

    16) What happens to a HTML page?

    The browser makes a HTTP request; the server gives a

  • 8/14/2019 Vb Questions

    15/30

    HTTP response to the browser and the browser convertsinto a HTML page.

    17) What happens to ASP pages?

    The browser makes a HTTP request; the server does theprocessing and gives a HTML response to the browser.

    18) What are the Web Servers supporting ASP?

    Internet Information Server (IIS) on Windows NT Personal Web Server (PWS) on Windows 95 Peer Web Services on Windows NT

    19) Explain the POST & GET Method or Explain thedifference between them.

    POST METHOD:The POST method generates a FORM collection, which issent as a HTTP request body. All the values typed in

    the form will be stored in the FORM collection.

    GET METHOD:The GET method sends information by appending it to

    the URL (with a question mark) and stored asA Querystring collection. The Querystring collection

    is passed to the server as name/value pair.The length of the URL should be less than 255

    characters.

    20) What is the command to display characters to theHTML page?

    Response.Write

    21) What is a variable?

    Variable is a memory location through which the actualvalues are stored/retrieved. Its value can be changed.

    22) What are LOCAL and GLOBAL variables?

    Local variables lifetime ends when the Procedure ends.Global variables lifetime begins at the start of thescript and ends at the end of the script and it can beused by any procedure within the script. Declaring avariable by using the keyword PRIVATE makes the

    variable global within the script, but if declaredusing PUBLIC, then all scripts can refer the variable.

    23) Naming constraints for a variable.

    It can be up to 255 charactersMust start with an alphabetMust not contain an embedded period or full-stop

    24) VBScript/ JavaScript is case- insensitive

  • 8/14/2019 Vb Questions

    16/30

    JavaScript is case sensitive

    25) What are the special sub-types in VBScript?

    EMPTY: has no valueNULL: Value does not exist (conjunction with database)OBJECT:

    26) What is the Order of precedence for LOGICALOperators.

    NOT, AND, OR, XOR, EQV, IMP

    27) What is Response Object?

    It controls the information sent to the user. Thevarious methods are:Response.Write Sends information directly to abrowser

    Response.Redirect Directs a user to a URL other thanthe requested URLResponse.ContentType Controls the type of contentsentResponse.Cookies Sets cookie valuesResponse.Buffer To Buffer information

    28) How will you set the values for cookies?

    .

    29) What is the function of Buffer in Response Object?

    Buffer controls the HTML output stream manually.

    30) What are the methods by which output stream iscontrolled?

    Flush sends previous buffered output to the clientimmediately, but continues processing the script. Clear erases any already-buffered HTML. End causes the server to stop processing thescript.

    31) What are the properties used to control theexpiration of the page?

    Expires specifies the number of minutes before apage cached on a browser expires. ExpiresAbsolute sets the date and time at which apage cached on a browser expires.

    32) What are the methods in Application Object?

    Lock prevents clients from modifying the variablesstored in the Application object. Unlock removes the lock from variables stored in

  • 8/14/2019 Vb Questions

    17/30

    the Application object.

    33) What are the event handlers of Application Object?

    Application_OnStart This event will be fired whenthe first visitor hits the page. Application_OnEnd This event runs when the serveris stopped.

    34) What is Session Object?

    It stores information about a Users session. Gives anotification when a user session begins or ends.

    35) What is a session?

    A user accessing an application is known as a session.

    36) What are the collections of Session Object?

    Contents collection contains all the variablesestablished for a session without using the tag. Static collection contains all the objects createdwith the tag within session scope.

    37) What are the properties of Session Object?

    SessionID returns the session identificationnumber for each user. Timeout sets the timeout period assigned to theSession object for any application, in minutes. CodePage determines the code page that will beused to display content. LCID a locale identifier, which determines timezone and language, rules for the system.

    38) What are the methods in Session Object?

    The Session Object has only one method, which isAbandon. It destroys all the objects stored in aSession Object and releases the server resources theyoccupied.

    39) Name some of the ASP components?

    Ad Rotator component a way to manage

    advertisements on the web site. Content Linker component a technique to directusers through a set of pages on a web site by creatinga list of URLs and description of the next andprevious pages. Browser Capabilities component allows to customizethe page to the ability of the browser viewing it. Database Access component allows to access datafrom the database

  • 8/14/2019 Vb Questions

    18/30

    40) What are Scripting Objects?

    Objects that can enhance the application are known asthe Scripting Objects.

    41) What are the ASP Scripting Objects?

    The Dictionary object, the FileSystemObject object,TextStream object.

    42) What is a Dictionary object?

    It lets you store and retrieve information in aflexible data structure. Each value or informationstored in a Dictionary is associated with a keythrough which the information can be retrieved.

    43) What is a FileSystemObject object?

    It provides access to the physical file system of the

    web server. It gets and manipulates information aboutall drives in a server, folders and sub-folders on adrive and files inside a folder.

    44) What is Server-Side includes?

    It provides extra information by which it makes thesite easier to manage. It can include text files usingthe #include statement, retrieve the size and lastmodification date of a file, defines how variables anderror messages are displayed and inserts the values ofHTTP variables in the page sent back to the browser.

    ASP Grade C

    1. What is the result of using Option Explicit?

    A. This applies only to Visual Basic, not VBScript.B. All variables must be dimensioned before use.C. All variables are dimensioned at run-time.D. Forces all controls to have a SELECTEDoption.E. Requires all variables be cast as specificDataTypes.

    2. What should be used in order to determine if thecookie "FavoriteFlavors" in the request objectcontains more than one entry?

    A. Request.Cookies("FavoriteFlavors").HasItemsB. Request.Cookies("FavoriteFlavors").Collection.CountC. Request.Cookies("FavoriteFlavors").DictionaryD. Request.Cookies("FavoriteFlavors").HasKeysE. Request.Cookies("FavoriteFlavors").Count

  • 8/14/2019 Vb Questions

    19/30

    3. When is the Session_OnStart event fired?

    A. Upon every request from an application by a clientfor an .asp document.B. Upon the first request from an application by aclient for any file in the application.C. Upon the first request for an .asp document from anapplication by a client.D. Upon the first request for the global.asa file, inwhich the event handler is located.E. Upon the first request for an. html or .aspdocument from an application by client

    4. What does Internet Information Server (IIS) assumeto be the default language for Active Server Pages?

    A. JscriptB. JavaScriptC. JAVAD. VBScript

    E. ECMAScript

    5. What should the developer use in order to have anActive Server Page (ASP) invokes a stored procedure ona SQL Server database?

    A. ADOB. RDOC. RDSD. OLEDBE. None of the above.

    6. onStart' and 'onEnd' are events of what object(s)?

    A. Application only.B. Session only.C. Server only.D. Application and Session only.E. Application, Session, and Server.

    7. What must be installed on an IIS4 machine to usethe CDONTS e-mail server object?

    A. FTP serviceB. SMTP serviceC. IIS administrator

    D. Exchange ServerE. IPX/SPX protocol

    8. Which line of code would instantiate the BrowserCapabilities component?

    A. objBrowser =Server.CreateObject("MSWC.BrowserType")B. Set objBrowser =Server.CreateObject("MSWC.BrowserType")

  • 8/14/2019 Vb Questions

    20/30

    C. var objBrowser =Server.CreateObject("MSWC.BrowserType")D. var objBrowser = CreateObject("MSWC.BrowserType")E. var objBrowser = Server.CreateObject("BrowserType")

    9. What is the Default ScriptTimeOut for ServerObject?A. 20 SecB. 30 SecC. 60 SecD. 90 Sec

    10. How many Max Cookies can we create in Server?A. 10B. 20C. 30D. 40

    11. How Many Types of CookiesA. 3B. 2C. 1D. 412.What is ASP (Active Server Pages)?

    ASP is a server side-scripting environment forbuilding dynamic and interactive web pages. Since thescripts run on the server side, the web server doesall the processing.

    13. What are the advantages of using ASP?

    Minimizes network traffic by limiting the need forthe browser and server to talk to each other Makes for quicker loading time since HTML pages areonly downloaded Allows to run programs in languages that are notsupported by the browser Can provide the client with data that does notreside on the clients machine Provides improved security measures since the scriptcannot be viewed bythe browser

    14. What is HTML(Hypertext Markup Language)?

    Its a method by which web pages can be built andgenerally used for formatting and linking text.

    15. What are the types of HTML?

    Static HTML Browser uses HTTP to request HTML filefrom the Web Server Dynamic HTML Browser uses HTTP to request an

  • 8/14/2019 Vb Questions

    21/30

    executable application rather than a Static HTML file

    16. What is the difference between ASP and HTML? OrWhy ASP is better than HTML?

    ASP executes code on the server side whereas thebrowser interprets HTML. ASP can use any scripting languages Gets feedback from the user and return informationto the user Create pages that will be customized to display onlythings that will be of interest to a particular user Can edit contents of a web page by updating a textfile or a database rather than the HTML code itself

    17. What is a Web Server?

    Its a Computer that provides Web services on theInternet or on a local Intranet. It is designed tolocate, address and send out simple HTML pages to all

    other users who access these pages.

    18. What is IIS?

    IIS is a Web Server that provides Web services, notonly for web pages but also for ftp sites and videoand audio services. It integrates with the databasefacilities of SQL Server.19. What do you need to run ASP?

    A browser and a Web server.

    20. What is a Scripting Language?

    It permits to create more interactive Web Pages.Validation, formatting of web pages can be done.VBScript, JavaScript are some examples.

    21. Which is the default Scripting Language of ASP(server-side)?

    VBScript

    22. Which is the default Scripting Language on theclient side?

    JavaScript

    23. What is Global.asa file?

    It is text file that contains details about an ASPapplication, such as when it should begin and end.

    24. Which is the default Data types in VBScript?

    Variant is the default data type in VBScript, whichcan store a value of any type.

  • 8/14/2019 Vb Questions

    22/30

    25. What is the Order of precedence for ARITHMETICOperators.

    ^, -(negation), *or /, \, mod, + or

    26. Where will you code OPTION EXPLICIT in an ASPapplication? WHY?

    It should be the first statement before the tagbecause ASP script is processed before the HTMLstatements.

    27. What are Constants? How will you declare aconstant?

    Constants have values that do not change during theexecution of the program. It can be declared using theterm CONST. (e.g.) Const pi = 3.143

    28. What are ARRAYS?

    Arrays are variables that store items of similarinformation.DIM ARRAY1(4) (declares an array with thename array1 with 5 elements)

    29. Arrays can be resized by using the keyword

    REDIM

    30. What is the maximum size of an array?

    Up to 60 dimensions.

    ASP OBJECTS

    31. Name the ASP Objects?

    Request Object Response Object Server Object Session Object Application Object

    32. What is Request Object?

    Gets information from the user. It has five

    collections by which values can be accessed. They are:Querystring, Form, Cookies, Server Variables &ClientCertificate

    33. What is Collection?

    Collection is a set of name/value pairs where theinformation supplied by the client is stored.

    34. What is application Object?

  • 8/14/2019 Vb Questions

    23/30

    Shares information among users of an application.Gives a notification when an application starts orends.

    35. What is Application-scope?

    Application-scope means that variables (and objects)can be accessed from any ASP pages that is part of theapplication.

    36. How many global.asa files can an Application have?

    Only one global.asa file and its placed in thevirtual directorys root.

    37. What are the collections of Application Object?

    * Contents collection contains all variables addedvia scripts in global.asa.

    * Static collection contains the names of allobjects added via the tag in global.asa.

    ASP - Grade A

    1.

    Referring to the above, if you want to pass thecontents ofthe strName variable in a hyperlink, which line ofcode would youuse?A. This cannot be done. The anchor is on the clientand thevariable is on the server.B.href="Encode.asp?name=">clickhereC. clickhereD. clickhereE. clickhere2.

  • 8/14/2019 Vb Questions

    24/30

    What would the above code load?

    A. Only the FunctionTwo.inc file into the ASP page.B. Both files, since Server Side Includes areprocessed before ASP interpreting.C. Only the FunctionOne.inc file into the ASP page.D. Neither file, since Server Side Includes areprocessed before ASP interpreting.E. Neither file, since the #INCLUDE statements arecommented out.3. What does the above code accomplish?A. It sends the browser the line of sample code, andthe browser executes it.B. It sends the response to"http://www.matsystems.com" instead of to the

    Requesting browser.C. It sends a redirection header back to the browser,and the browser then requests the new targetdocument.D. The redirection occurs on the server-side, and thefirst response the browser gets is the head and bodyof the new target document.E. It causes the server to send a request to thetarget URL and passes the response to the requestingbrowser.

    4. How are sessions maintained?

    A. The browser sends a cookie to the server with eachrequest.B. The browser sends a Querystring variable to theserver with each request.C. The browser sends a hidden Form variable to theserver with each request.D. The browser sends a long variable to the server inthe BODY of each request.E. None of the above.

    5. When does the application OnEnd event handler fire?A. After every request for an application document,since web servers are stateless servers.

    B. As soon as there are no open connections to anyapplication document.C. When the web server is stopped in an orderlyfashion.D. Twenty minutes after the last request for adocument in the application.E. When there are no application requests for theamount of time defined by the SessionTimeout variable.

    6. How long is a SessionID guaranteed to be unique?

    http://www.sql.com/http://www.matsystems.com/http://www.sql.com/http://www.matsystems.com/
  • 8/14/2019 Vb Questions

    25/30

  • 8/14/2019 Vb Questions

    26/30

    the client.B. Only files and subdirectories in the web site'shome directory.C. Any local physical drive or mapped drive on the webserver.D. Any file system physically located on the webserver.E. The client's computer.10. What purpose is served by the Application.Lockmethod?

    A. It locks the Application object, preventing otherclients from altering any values in the Contentscollection.B. It locks the application, preventing the serverfrom responding to any requests for applicationdocuments.C. It locks the application, preventing non-SSLrequests from being processed.

    D. It locks the Application object, preventing otherclients from reading any values in the Contentcollection.E. It locks other clients from reading the Contentscollection.

    11. How to Display images using Response object?

    A. Contenttype=Application/BrushB. Contenttype=Image/JPGC. Contenttype=Application/paintD. Contenttype=Image/WMF

    12.What is the use of following StatementResponse.Expires=120

    A.The page will be removed form cache after 120 HoursB.The page will be removed form cache after 120 SecC.The page will be removed form cache before 120 MinD.The page will be removed form cache after 2 Hours

    13. Which choice is NOT a property of DictionaryObject?

    A. Key()B. CompareMode

    C. Item ()D. Exists ()E. Count

    14. Using VBScript, which of the following ScriptingObject(s) is NOT available from scrrun.dll?

    A. TextStreamB. Dictionary ObjectC. Err Object

  • 8/14/2019 Vb Questions

    27/30

    D. FileSystemObjectE. All are available from scrrun.dll.

    15. What is a .ASP file?

    It is a Text File that contains the combination of thefollowing: Text HTML tags Script Commands

    16.How are scripts executed?

    ASP provides scripting engines that execute thecorresponding scripting languages on the server side.Scripts should be encoded within the Delimiters.

    17. What are the browsers that can access ASP pages?

    Internet Explorer (supports VBScript, JavaScript) Netscape Communicator/ Navigator (supports onlyJavaScript, VBScript can be also added too)

    18. What is a "Virtual Directory"?

    Virtual directories are aliases for directory paths onthe server.It allows moving files on the disk between differentfolders, drives or even servers without changing thestructure of web pages. It avoids typing an extremelylong URL each time to access an ASP page.

    19. What is the difference between client-side scriptand server-side script?

    Scripts executed only by the browser withoutcontacting the server is called client-side script. Itis browser dependent. The scripting code is visible tothe user and hence not secure. Scripts executed by theweb server and processed by the server is calledserver-side script.

    20. Give the comment Tags for the following:

    VBScript : REM & (apostrophe)JavaScript : // (single line comment)

    /* */ (Multi-line comments)

    21.How can you disable the browser to view the code?Writing codes within the Tag.

    22. How does the server identify and execute theserver-side scripts within HTML code? Including the RUNAT=SERVER attribute in the tag Use server script delimiter

  • 8/14/2019 Vb Questions

    28/30

    23. How can you change the primary scripting languagefor a page?

    Specify

    24. What is the order of execution for an ASPapplication?

    1) Global.asa2) Server-side Includes3) Jscript scripts tagged within tags4) HTML together with scripts tagged within delimiters5) VBScripts tagged within tags

    25. What are the tasks performed by tags?

    tags provides space for the user to inputvalues

    the form has a button to submit information back tothe server It transfers control to another ASP page It carries the information in the fields to anotherASP page

    26. What are the attributes of the tags? Whatare their functions?

    The two attributes are ACTION and METHODThe ACTION gives the name of the ASP file that shouldbe opened next by which this file can access theinformation given in the formThe METHOD determines which of the two ways (POST orGET) the browser can send the information to theserver

    27. What are the tags necessary to be present withinthe tag? tag: Provides input spaces (text boxes, comboboxes, radio button, etc.) on a form called fields.It has three attributes TYPE, NAME and VALUE. TYPEprovides the characteristics of the field and the NAMEspecifies a name to the field by which it can bereferred.

    28. What is Querystring collection?

    This collection stores any values that are provided inthe URL. This can be generated by three methods: By clicking on an anchor tag By sending a form to the server by the GET method Through user-typed HTTP address

    29. What is a Form collection?The Form collection holds the values of the formelements submitted with the POST method. This is theonly way to generate a Form collection.

  • 8/14/2019 Vb Questions

    29/30

    30. What is the difference between Querystringcollection and Form collection?The main difference is that the Querystring collectiongets appended to a URL(with a ?) and can be generatedby three ways whereas the Form collection is sent aspart of the HTTP request body and there is only way togenerate a Form collection.

    31. What is Cookies collection?Cookies are text files that store information aboutthe user by which the web server identifies and markseach different visitor to a web site and determineswhere a user has been before. A cookie can storeinformation only when the user sends it. Individualcookies are limited to 4KB of data. The maximum numberof cookies allowed is 300. Cookies are stored onclients machine.

    32. What is the difference between Cookies collection

    and Form/Querystring collection?

    Cookie collection does not have the Count property.Cookies can have multiple values for the same cookiename but each value can be referred using a keywhereas in a Form/Querystring cookie each value has tobe referred using a index value.

    33. What is ServerVariables collection?

    The ServerVariables collection holds all of the HTTPheaders and also additional items of information aboutthe server.

    34. What is ClientCertificate collection?

    A ClientCertificate is an encrypted number that isstored in a file on the users computer. This storesdetails of any security certificates included withthe request.

    35. What are the event handlers of Session Object? Session _OnStart This event will be fired when anew user begins a session with the web site. Session_OnEnd This event is called whenever asession terminates.

    36. What are the advantages of Cookies over SessionObject?

    It informs each page what session the requestbelongs to when a user accesses during a session. It retrieves all the session information stored onthe server. Cookies can persist for a much longer period of timethan session that has a timeout value usually of 20minutes and hence can store information even when a

  • 8/14/2019 Vb Questions

    30/30

    user is off the site.

    37. How will you delete a Cookie?

    By setting its Expires property to any date prior totodayResponse.Cookies("cookie name").Expires = Date 1.

    38. What is Server Object?Controls the ASP execution environment. It can set theamount of time script can run before an error occurs.Converts a virtual path to a physical path on theserver. Takes a user supplied string and encode itinto proper format for a URL string.

    39. What is a TextStream object?It allows you to access(read/write) the contents oftext files stored on the web server.

    40. What is an Err Object? Name its properties and

    methods?

    An object used to trap errors in the application.Description, Number, Source, HelpFile and HelpContextare its properties and Raise and Clear are its method.

    41. What is Extranet?

    An area of a web site available only to a set ofregistered visitors.

    Difference between textbox and Rich textbox