Vb Questions

May 13, 2018 | Author: Amit Rathi | Category: Http Cookie, Active Server Pages, Web Server, Html Element, Web Page
Share Embed Donate

Short Description

Download Vb Questions...


VB Questions (General)


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.


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 siz size allowed wed for Msgb sgbox 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. 12.

What is ke keywor word us used to to com comp pare to to ob objects cts?

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 procedure wont return values…

14. 14. Wher Where e wil will l we we giv give e the the opti option on expl explic icit it keyw keywor ord d and and for what? In the general declarations section. To trap undeclared variables.


What is Friend Variable?

Scope sharable between projects. 16. 16.

What is bi bindin ding? Wh What ar are ty types of of bi binding ing?

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. 17. What What is the the dif diffe fere renc nce e bet betwe ween en Prop Proper erty ty Get, Get, Set 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.


What is Ma Mask Ed Edit an and wh why it it is us used?

Control. Restricted data input as well as formatted data output.

19. 19.

Drag and Dr Drop state ate nu numbers and fu funct nctions. ns.

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

What What are are the the type type of vali valida dati tion on avai availa labl ble e in in VB? VB?

Field, Form

21. 21. With With in the the for form m we we want want to chec check k all all the the text text box box control are typed or not? How? For each currentcontrol in controls if typeof currentcontrol is TextBox then end if next

22. 22.

What What is the the res resul ult t of Null Null * Any Any valu value e = 0 (Zer (Zero) o). .

23. 23. What What is cont contro rol l arra array y and and How How many many we can can have have it with in the form? Group of control share the same name. Max 32, 767.

24. 24. What What is the the def defau ault lt mode model l of of the the form form? ? And And what what is it number? VbModaless – 0 (Zero) – We can able to place another window above this form. 25. 25. Supp Suppos ose e from from form form1 1 to form form2 2 obje object ct prop proper erty ty settings will arise to ? Invalid procedure call or argument (Run time error – 5) 26. 26. What What is the the dif diff f bet betwe ween en the the Std Std and and Cla Class ss Modu Module le? ? 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 ty type of of In 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 "" lib "" Alias "" (Arg, …..) as Return type.


What is MDI form? MDI Styles?

We can have only one MDI form Document Interface. This form set the Child property of the forms inside this MDI. Style availables 1. VbCascade

for a project. Multiple type is VBModal. We have forms to True to place 2. VbTitle Horizontal


How ma many im images ca can be be pl placed in in th the im image li list ?

64 3.

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

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

What is Zorder Method?

Object.Zorder = 1 or 0 Place a Specified mdiform form or control at the front or back of the z-order with n its Graphical Level. 6. What is is di diff be between th the Ge Generic Va Variable an 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). 7. What ar are pr properties av available in in Cl Clip Bo Board? No Properties Available. Only the methods they are SetText, GetText, Setdata(), Getformat(), Clear. 8.

What is Dll?

Libraries of procedure external to the application but

can be called from the application. 9. What is Tabstr strip contro trol? What is the the star tarting 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 10.

Why we use Treeview Control?

To list the hierarchial list of the node objects. Such of files and Directories. 11. 11.

Why we we ne need OL OLE-Aut Automat mation?A n?Advant antages ges?

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). 12. 12. What What is the the dif diff f bet betwe ween en the the Cre Creat ate e Obj Objec ect t and and Get Get object? Create Object - To create an instance of an object. Get Object – To get the reference to an existing object. 13. 13. Have Have you you cre creat ate e Pro Prope pert rtie ies s and and Meth Method ods s for for your your own Controls? Properties – Public variable of a Class Method – Public procedure of a class 14.

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

What is Static Variable?

Its Scope will be available through out the life time. 16.

Private Dim x as integer.

Private cannot be used in front of DIM. 17.

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

What are th the sc scope of th the cl class?

Public , private, Friend 19. 19. Can Can we able able to set set Inst Instan anci cing ng prop proper erti ties es like like Singleuse, GlobalSingleuse to ActiveXDll? No. 20. 20. In proj projec ect t pro prope pert rtie ies s if if we we set set Unat Unatte tend nded ed what what is it mean? This cannot have user interface. This can be used for the COM creation. 21. 21.

What are th the St Style Prop ropertie ties of of Com Comb bo Bo Box?

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

What are th the St Style prop ropertie ties of of Lis List t Box Box? ?

Simple –Single Select , Extended. – Multiple Select. 23. 23.

What are th the di differ ferent types pes of of Di Dialo alog Bo Box?

Predefined, Custom, User Defined. 24.

What is Parser Bug?

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

What is th the Dl Dll re require ired fo for run runn ning the VB VB?

Vbrun300.dll 26.

Can We We create CGI sc scripts in in VB?

Yes. 27.

How to change the Mouse Pointer?

Screen.MousePointer = VBHourGlass/VBNormal. 28. 28.

How to che check the condit dition in Msg Msgbox? ox?

If(Msgbox("Do you want to delete this

Record",VbYesNo)=VbYes)Then End if

VB Questions (Client Server) 1. What is di differ ference betw etween da datagr agrid an and fl flexgri grid? 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 an and Nu Number available in VB VB?

3. 1- Dynaset, 0 – Table, 2 – Snap Shot. 6. Refer ferentia tial In Integri grity (T (Take care By je jet da databas base 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

1. 2. 3. 4.

4 types of locks. They are Batch Optimistic Optimistic Pessimistic 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 resource requirements requirements · Not available 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 · Al Allows disconnected scenarios · Other us users able to ac 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 ca can we we cal call Sto Stored proce ocedure of Ba Back En End in in RDO RDO and ADO ? In RDO – We can call using RDO Query Objects. In ADO – We can call using Command Objects. 8. What is th the di differe erent be betwee ween Mi Microso osoft OD ODBC Dr Driver ver 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 th the Te Techno hnologi ogies fo for Acc Accessi ssing Da Databas base 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 then Declare the Query Def qy Set Qy as New Query def Qy.SQL = "{Call ProcedureName(?,?,?)}" qy(0)=val(Txt1.Text) qy(1)=val(Txt2.Text) qy(2)=val(Txt3.Text) Set Rs = Qy.OpenresultSet Txt(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. 13.

What are the differ ferent types pes of error ror?

Syntax Errors, Runtime , Logic. 14. 14. What What is Seek Seek Meth Method od whic which h typ type e of of reco record rd set set is is available this? Only in DbOpenTables. Syntax: rs.index = "empno" rs.seek "=" , 10 If with our setting the rs.index then run time error will occur. 15. 15.

What is Ce Centra tralizat zation Error ror Han Hand dling ing?

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. 17. To conn connec ect t the the Data Data Cont Contro rol l wit with h Bac Back k end end What What are are all the properties to be set?

Data source Name, Record Source Name 18.

How to trap Data Base Error?

Dim x as RDOError X(0).Des X(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. 20.

What What meth method ods s are are used used for for DBG DBGri rid d in in unb unbou ound nd mode mode? ?

AddData, EditData, Readdata, WriteData. 21. 21. How to to in increas ease th the Da Date co correspo spondin ding wi with month,date,year? DateSerial(year(Now),Month(Now)+1,1) Hour, min, sec, month, year, DateSerial, dateadd, datediff, weekday, datevalue, timeserial,timevalue.


Setting the Cursors.

Default Cursor – 0 ODBC Cursor (Client side) – 1 ServerSide Cursors (More Network traffic) - 2 23.

Cursor ma 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 1 RdOpenDynamic 2 RdOpenKeySet 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 3 RdConcurBatch 4 26.

What the RDO Methods and Events?

Methods Events

Begin Trans Validate Commit Trans Reposition Rollback Trans Error Cancel Query Complied Refresh Update Controls Update 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 Le Less Co 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. 34.

RdoP RdoPar aram amet eter er Obje Object ct RdoP RdoPar aram amet eter erCo Cons nsta tant nt

Direction RdparamInput RdparamInputOutput RdParamOutput Name Type Value . *********************************************************************** ****************

ASP – 1. a = 1

a = 2 In the sample code shown above, what will be written to the screen? A. 1 B. 2 C. 1, 2 D. 1&2 E. Nothing. 2. The above code appears in the global.asa file. What would it accomplish? A. It would create a "Thing" object and place it in Contents Collection of the Application object. B. It would create a "Thing" object and place it in StaticObjects Collection of the Application object. C. It would create a "Thing" object and place it in the 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 because the code requires the Application.Lock and Application.Unlock methods. 3. Referring to the above, what is the value of iPos? A. B. C. D. E.

0 1 2 8 9

4. In the database table, if the datatype for field1 (shown above) is Number, what is the value of varType? A. The field value. B. A string description. C. The field name.

D. NULL. E. An enumerator. 5. What is the program ID (ProgID) for ActiveX Data Objects in 2-tier and 3-tier database applications? A. B. C. D. E.


6. Which choice is NOT an ADO collection? A. B. C. D. E.

Properties Records Fields Errors Parameters

7. Which will NOT set the scope of an Active Server Component? A. Setting the [component name].scope property. B. Using the Server.CreateObject method. C. Placing it in the Session or Application OnStart event handler. D. Instantiating the component in the global.asa file. E. Using the tag. 8. How to handle Error in ASP A. B. C. D.

Using Using Using Using

On On On On

Error Error Error Error

Goto Resume Resume Next Goto 0

9. What would be the result of the above code? A. B. C. D. E.

Type mismatch error "Hello World, Hello World, Hello World" 0 "Hello World 3" "Hello World"

10. What happens when a client submits a form which changes the value of an Application variable? A. Client actions cannot change Application variables.

B. The change is not visible to any client until the application is stopped and started. C. The change is only visible to future requests made by that client during their current session. D. The change is visible to all clients, but only after they complete their current sessions and begin a new session. E. The change is visible to all clients immediately after the form is processed by the server. 11. ADO is an object model for accessing which of the following? A. B. C. D. E.

Relational data via Jet. Local or SQL data via Jet. Relational data via ODBC. Non-relational data via DSN-less ODBC. All types of data via OLE DB.

12. Which of the following are Server Object methods ( Choose Two) A. HTMLEncode,MapPath B. URLEncode,ScriptTimeout C. URLEncode,CreateObject D. ScriptTimeout,Abandon 13. Following is the code Server.MapPath (".") consider the path is C:\Inetpub\WWWRoot\MAT\Default.asp. What will be the output A. B. C. D.

C:\InetPUb C:\InetPUb\WWWroot C:\InetPUb\wwwroot\MAT Error

14. ClientCertificate is a collection of A. B. C. D.

Server Response Request ObjectContext

15. IsClientConnected is a property of A. B. C. D.

Server Response Request Sesssion

16) What happens to a HTML page? The browser makes a HTTP request; the server gives a

HTTP response to the browser and the browser converts into a HTML page. 17) What happens to ASP pages? The browser makes a HTTP request; the server does the processing 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 the difference between them. POST METHOD: The POST method generates a FORM collection, which is sent 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 as A 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 the HTML page? Response.Write 21) What is a variable? Variable is a memory location through which the actual values 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 the script and ends at the end of the script and it can be used by any procedure within the script. Declaring a variable by using the keyword PRIVATE makes the variable global within the script, but if declared using PUBLIC, then all scripts can refer the variable. 23) Naming constraints for a variable. It can be up to 255 characters Must start with an alphabet Must not contain an embedded period or full-stop 24) VBScript/ JavaScript is case- insensitive

JavaScript is case sensitive 25) What are the special sub-types in VBScript? EMPTY: has no value NULL: Value does not exist (conjunction with database) OBJECT: 26) What is the Order of precedence for LOGICAL Operators. NOT, AND, OR, XOR, EQV, IMP 27) What is Response Object? It controls the information sent to the user. The various methods are: Response.Write – Sends information directly to a browser Response.Redirect – Directs a user to a URL other than the requested URL Response.ContentType – Controls the type of content sent Response.Cookies – Sets cookie values Response.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 is controlled? · Flush – sends previous buffered output to the client immediately, but continues processing the script. · Clear – erases any already-buffered HTML. · End – causes the server to stop processing the script. 31) What are the properties used to control the expiration of the page? · Expires – specifies the number of minutes before a page cached on a browser expires. · ExpiresAbsolute – sets the date and time at which a page cached on a browser expires. 32) What are the methods in Application Object? · Lock – prevents clients from modifying the variables stored in the Application object. · Unlock – removes the lock from variables stored in

the Application object. 33) What are the event handlers of Application Object? · Application_OnStart – This event will be fired when the first visitor hits the page. · Application_OnEnd – This event runs when the server is stopped. 34) What is Session Object? It stores information about a User’s session. Gives a notification 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 variables established for a session without using the tag. · Static collection – contains all the objects created with the tag within session scope. 37) What are the properties of Session Object? · SessionID – returns the session identification number for each user. · Timeout – sets the timeout period assigned to the Session object for any application, in minutes. · CodePage – determines the code page that will be used to display content. · LCID – a locale identifier, which determines time zone and language, rules for the system. 38) What are the methods in Session Object? The Session Object has only one method, which is Abandon. It destroys all the objects stored in a Session Object and releases the server resources they occupied. 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 direct users through a set of pages on a web site by creating a list of URLs and description of the next and previous pages. · Browser Capabilities component – allows to customize the page to the ability of the browser viewing it. · Database Access component – allows to access data from the database

40) What are Scripting Objects? Objects that can enhance the application are known as the 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 a flexible data structure. Each value or information stored in a Dictionary is associated with a key through 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 about all drives in a server, folders and sub-folders on a drive and files inside a folder. 44) What is Server-Side includes? It provides extra information by which it makes the site easier to manage. It can include text files using the #include statement, retrieve the size and last modification date of a file, defines how variables and error messages are displayed and inserts the values of HTTP 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 SELECTED option. E. Requires all variables be cast as specific DataTypes. 2. What should be used in order to determine if the cookie "FavoriteFlavors" in the request object contains more than one entry? A. B. C. D. E.

Request.Cookies("FavoriteFlavors").HasItems Request.Cookies("FavoriteFlavors").Collection.Count Request.Cookies("FavoriteFlavors").Dictionary Request.Cookies("FavoriteFlavors").HasKeys Request.Cookies("FavoriteFlavors").Count

3. When is the Session_OnStart event fired? A. Upon every request from an application by a client for an .asp document. B. Upon the first request from an application by a client for any file in the application. C. Upon the first request for an .asp document from an application by a client. D. Upon the first request for the global.asa file, in which the event handler is located. E. Upon the first request for an. html or .asp document from an application by client 4. What does Internet Information Server (IIS) assume to be the default language for Active Server Pages? A. B. C. D. E.

Jscript JavaScript JAVA VBScript ECMAScript

5. What should the developer use in order to have an Active Server Page (ASP) invokes a stored procedure on a SQL Server database? A. B. C. D. E.

ADO RDO RDS OLEDB None of the above.

6. ‘onStart' and 'onEnd' are events of what object(s)? A. B. C. D. E.

Application only. Session only. Server only. Application and Session only. Application, Session, and Server.

7. What must be installed on an IIS4 machine to use the CDONTS e-mail server object? A. B. C. D. E.

FTP service SMTP service IIS administrator Exchange Server IPX/SPX protocol

8. Which line of code would instantiate the Browser Capabilities component? A. objBrowser = Server.CreateObject("MSWC.BrowserType") B. Set objBrowser = Server.CreateObject("MSWC.BrowserType")

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 Server Object? A. B. C. D.

20 30 60 90

Sec Sec Sec Sec

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

10 20 30 40

11. How Many Types of Cookies A. 3 B. 2 C. 1 D. 4 12.What is ASP (Active Server Pages)? ASP is a server side-scripting environment for building dynamic and interactive web pages. Since the scripts run on the server side, the web server does all the processing. 13. What are the advantages of using ASP? · Minimizes network traffic by limiting the need for the browser and server to talk to each other · Makes for quicker loading time since HTML pages are only downloaded · Allows to run programs in languages that are not supported by the browser · Can provide the client with data that does not reside on the client’s machine · Provides improved security measures since the script cannot be viewed by the browser 14. What is HTML(Hypertext Markup Language)? It’s a method by which web pages can be built and generally used for formatting and linking text. 15. What are the types of HTML? · Static HTML – Browser uses HTTP to request HTML file from the Web Server · Dynamic HTML – Browser uses HTTP to request an

executable application rather than a Static HTML file 16. What is the difference between ASP and HTML? Or Why ASP is better than HTML? · ASP executes code on the server side whereas the browser interprets HTML. · ASP can use any scripting languages · Gets feedback from the user and return information to the user · Create pages that will be customized to display only things that will be of interest to a particular user · Can edit contents of a web page by updating a text file or a database rather than the HTML code itself 17. What is a Web Server? It’s a Computer that provides Web services on the Internet or on a local Intranet. It is designed to locate, 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, not only for web pages but also for ftp sites and video and audio services. It integrates with the database facilities 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 the client side? JavaScript 23. What is Global.asa file? It is text file that contains details about an ASP application, 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, which can store a value of any type.

25. What is the Order of precedence for ARITHMETIC Operators. ^, -(negation), *or /, \, mod, + or – 26. Where will you code OPTION EXPLICIT in an ASP application? WHY? It should be the first statement before the tag because ASP script is processed before the HTML statements. 27. What are Constants? How will you declare a constant? Constants have values that do not change during the execution of the program. It can be declared using the term CONST. (e.g.) Const pi = 3.143 28. What are ARRAYS? Arrays are variables that store items of similar information.DIM ARRAY1(4) (declares an array with the name 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 the information supplied by the client is stored. 34. What is application Object?

Shares information among users of an application. Gives a notification when an application starts or ends. 35. What is Application-scope? Application-scope means that variables (and objects) can be accessed from any ASP pages that is part of the application. 36. How many global.asa files can an Application have? Only one global.asa file and it’s placed in the virtual directory’s root. 37. What are the collections of Application Object? * Contents collection – contains all variables added via scripts in global.asa. * Static collection – contains the names of all objects added via the tag in global.asa.

ASP - Grade A

1. Referring to the above, if you want to pass the contents of the strName variable in a hyperlink, which line of code would you use? A. This cannot be done. The anchor is on the client and the variable is on the server. B. href="Encode.asp?name=">click here C. click here D. click here E. click here 2.

What would the above code load? A. Only the FunctionTwo.inc file into the ASP page. B. Both files, since Server Side Includes are processed before ASP interpreting. C. Only the FunctionOne.inc file into the ASP page. D. Neither file, since Server Side Includes are processed before ASP interpreting. E. Neither file, since the #INCLUDE statements are commented out. 3. What does the above code accomplish? A. It sends the browser the line of sample code, and the 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 target document. D. The redirection occurs on the server-side, and the first response the browser gets is the head and body of the new target document. E. It causes the server to send a request to the target URL and passes the response to the requesting browser. 4. How are sessions maintained? A. The browser sends a cookie to the server request. B. The browser sends a Querystring variable server with each request. C. The browser sends a hidden Form variable server with each request. D. The browser sends a long variable to the the BODY of each request. E. None of the above.

with each to the to the server in

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 any application document. C. When the web server is stopped in an orderly fashion. D. Twenty minutes after the last request for a document in the application. E. When there are no application requests for the amount of time defined by the SessionTimeout variable. 6. How long is a SessionID guaranteed to be unique?

A. It is unique for the web server, whether it is restarted or not. B. Only until the web server is restarted. C. It is like a GUID in that it is for any web server at any time. D. Only until the session expires, then it can be reissued to another client. E. It is unique per client. A client cannot have two sessions with the same SessionID 7.Which-code sample will report whether the client's browser supports cookies? A. B. You can only use JavaScript for this. C. D. E. 8. Male Female Referring to the above, which line of code would retrieve the selected radio button value? A. For cnt=0 to rbSex.count - 1 If rbSex(cnt).value = selected Then strSex = rbSex(cnt).value exit for End If Next B. strSex = Request("rbSex").selected.value C. strSex = Request("rbSex") D. strSex = Request.rbSex.value E. For Each value in rbSex If rbSex.selected = true strSex = value exit for Next 9. The FileSystemObject provides an object interface to drives, directories, and files for which of the following? A. Any local or mapped drive on either the server or

the client. B. Only files and subdirectories in the web site's home directory. C. Any local physical drive or mapped drive on the web server. D. Any file system physically located on the web server. E. The client's computer. 10. What purpose is served by the Application.Lock method? A. It locks the Application object, preventing other clients from altering any values in the Contents collection. B. It locks the application, preventing the server from responding to any requests for application documents. C. It locks the application, preventing non-SSL requests from being processed. D. It locks the Application object, preventing other clients from reading any values in the Content collection. E. It locks other clients from reading the Contents collection. 11. How to Display images using Response object? A. B. C. D.

Contenttype=Application/Brush Contenttype=Image/JPG Contenttype=Application/paint Contenttype=Image/WMF

12.What is the use of following Statement Response.Expires=120 A.The B.The C.The D.The

page page page page

will will will will

be be be be

removed removed removed removed

form form form form

cache cache cache cache

after 120 Hours after 120 Sec before 120 Min after 2 Hours

13. Which choice is NOT a property of Dictionary Object? A. B. C. D. E.

Key() CompareMode Item () Exists () Count

14. Using VBScript, which of the following Scripting Object(s) is NOT available from scrrun.dll? A. TextStream B. Dictionary Object C. Err Object

D. FileSystemObject E. All are available from scrrun.dll. 15. What is a .ASP file? It is a Text File that contains the combination of the following: · Text · HTML tags · Script Commands 16.How are scripts executed? ASP provides scripting engines that execute the corresponding 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 only JavaScript, VBScript can be also added too) 18. What is a "Virtual Directory"? Virtual directories are aliases for directory paths on the server. It allows moving files on the disk between different folders, drives or even servers without changing the structure of web pages. It avoids typing an extremely long URL each time to access an ASP page. 19. What is the difference between client-side script and server-side script? Scripts executed only by the browser without contacting the server is called client-side script. It is browser dependent. The scripting code is visible to the user and hence not secure. Scripts executed by the web server and processed by the server is called server-side script. 20. Give the comment Tags for the following: VBScript : JavaScript : /* */ (Multi-line comments)

REM & ‘(apostrophe) // (single line comment)

21.How can you disable the browser to view the code? Writing codes within the Tag. 22. How does the server identify and execute the server-side scripts within HTML code? · Including the RUNAT=SERVER attribute in the tag · Use server script delimiter

23. How can you change the primary scripting language for a page? Specify 24. What is the order of execution for an ASP application? 1) Global.asa 2) Server-side Includes 3) Jscript scripts tagged within tags 4) HTML together with scripts tagged within delimiters 5) VBScripts tagged within tags 25. What are the tasks performed by tags? · tags provides space for the user to input values · the form has a button to submit information back to the server · It transfers control to another ASP page · It carries the information in the fields to another ASP page 26. What are the attributes of the tags? What are their functions? The two attributes are ACTION and METHOD The ACTION gives the name of the ASP file that should be opened next by which this file can access the information given in the form The METHOD determines which of the two ways (POST or GET) the browser can send the information to the server 27. What are the tags necessary to be present within the tag? tag: Provides input spaces (text boxes, combo boxes, radio button, etc.) on a form called fields. It has three attributes TYPE, NAME and VALUE. TYPE provides the characteristics of the field and the NAME specifies a name to the field by which it can be referred. 28. What is Querystring collection? This collection stores any values that are provided in the 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 The Form elements only way

is a Form collection? collection holds the values of the form submitted with the POST method. This is the to generate a Form collection.

30. What is the difference between Querystring collection and Form collection? The main difference is that the Querystring collection gets appended to a URL(with a ?) and can be generated by three ways whereas the Form collection is sent as part of the HTTP request body and there is only way to generate a Form collection. 31. What is Cookies collection? Cookies are text files that store information about the user by which the web server identifies and marks each different visitor to a web site and determines where a user has been before. A cookie can store information only when the user sends it. Individual cookies are limited to 4KB of data. The maximum number of cookies allowed is 300. Cookies are stored on client’s 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 cookie name but each value can be referred using a key whereas in a Form/Querystring cookie each value has to be referred using a index value. 33. What is ServerVariables collection? The ServerVariables collection holds all of the HTTP headers and also additional items of information about the server. 34. What is ClientCertificate collection? A ClientCertificate is an encrypted number that is stored in a file on the user’s computer. This stores details of any security certificates included with the request. 35. What are the event handlers of Session Object? · Session _OnStart – This event will be fired when a new user begins a session with the web site. · Session_OnEnd – This event is called whenever a session terminates. 36. What are the advantages of Object?

Cookies over Session

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

user is off the site. 37. How will you delete a Cookie? By setting its Expires property to any date prior to today Response.Cookies("cookie name").Expires = Date – 1. 38. What is Server Object? Controls the ASP execution environment. It can set the amount of time script can run before an error occurs. Converts a virtual path to a physical path on the server. Takes a user supplied string and encode it into proper format for a URL string. 39. What is a TextStream object? It allows you to access(read/write) the contents of text files stored on the web server. 40. What is an Err Object? Name it’s properties and methods? An object used to trap errors in the application. Description, Number, Source, HelpFile and HelpContext are its properties and Raise and Clear are its method. 41. What is Extranet? An area of a web site available only to a set of registered visitors.

Difference between textbox and Rich textbox

View more...


Copyright ©2017 KUPDF Inc.