Top 50 Vbscript Advanced Interview Questions
Q1. Why To Use Option Explicit In Vb Script?
If we claim variables with a few values and even as using if we use (spell mistake) then user can’t recognise
‘ setting alternative explicit is beneficial there ‘ Example begins here option explicit dim abcd abcd=20 msgbox abcd dim bcde bcde=30 msgbox bcdef
Q2. Explain About Arrays In Vb Script?
Arrays in VB Script have to be assigned within the variant separated by a comma. If arguments are not exact then the string is regarded as empty. After specifying the factors in an array an index wide variety must be used indicating the favored element.
Q3. Explain Sga Memory Structures?
SGA (System Global Area) is a dynamic reminiscence place of an Oracle Server. In SGA,the allocation is accomplished in granuels. The length of the SGA is depending on SGA_MAX_SIZE parameter.
The memory systems contained with the aid of SGA are:
Shared Pool :
this memory shape is divided into sub-structures which can be Library Cache and Data Dictionary Cache for storing lately used PL/SQL statements and the recent statistics definitions. The maximum size of the Shared Pool depends on the SHARED_POOL_SIZE parameter.
Database Buffer Cache :
This memory structure improves the performance while fetching or updating the recently used information because it shops the currently used datafiles. The length of this block is determined by using DB_BLOCK_SIZE.
Redo Log Buffer :
This memory structure is used to store all the adjustments made to the database and it is basically used for the information recovery purposes. The length of this block is decided by using LOG_BUFFER.
Java Pool :
This memory structure is used when Java is established at the Oracle server. Size that may be used is stored in parameter named JAVA_POOL_SIZE.
Large Pool :
This reminiscence structure is used to reduce the load of the Shared Pool, as the Session reminiscence for the Shared Server, because the temporary storage for the I/O and for the backup and restore operations or RMAN. Parameter that shops the most size is LARGE_POOL_SIZE.
Q4. How To Write Functions And Sub In Vb Script?
Function add(a,b) sum=a+b add=sum give up function s=add(6,8) msgbox s sub add2(x,y) sum=x+y msgbox sum give up sub call add2(6,8)
Q5. Explain About The Extension .Hta?
.Hta extension is used whenever you want to consist of a VB script in HTML. Here HTML acts as an interface and VB Script as the programming language. .Hta extension documents do run within the safe and relied on region of Internet explorer. Although they run in the relied on region querying is confined as it has to skip the hints of net explorer.
Q6. Is Vbscript A Case-sensitive Or Case-insensitive?
VBScript is a case-insensitive programming language; i.E. Case is neglected while studying VBScript scripts. So myVar, MyVar, MYvar all talk over with the equal variable.
Q7. Explain About Operator Precedence In Vb Script?
In operator precedence expressions are evaluated and resolved in a predetermined order. The order of assessment may be modulated in case you use parenthesis. Expressions found in parenthesis are evaluated first.
Q8. Difference Between Dim,public And Private Variables In Vb Script?
Use of dim ,personal and public variables in vb script characteristic first
dim a
a=20
msgbox a ‘ 20 presentations
give up function
first
msgbox a ‘ this gives empty value
‘ so dim variables are not public if we use within characteristic
dim b
b=30
characteristic second
msgbox b ‘ 30 presentations
end function
2d
‘ if we declare dim variables outside the characteristic then it will act as public
class myclas
public c
non-public d
dim e
sub mysub
c=40
d=50
e=60
msgbox “public:“&c&” non-public :”&d&”dim :”&e
end sub
cease magnificence
set obj=new myclas
obj.Mysub
msgbox obj.C
‘msgbox obj.D ‘it received’t allow to show private
variables
msgbox obj.E
Q9. Give Examples Where Vb Script Can Directly Run On Users System With Windows As Os?
A simple instance detailing the jogging of VB Script is via making use of Windows Script host environment. Visual fundamental is a stand alone software which has a .Vbs as extension. Input may be furnished through graphical consumer interface and output can be received by means of Wscript.Exe from dialog and enter packing containers. From command line it can be invoked by means of Cscript.Exe.
Q10. Explain About Constants In Vb Script?
There are many beneficial constants present in Visual primary script which you can use to your code. They ease your paintings load through remembering cost and imposing inside the code. Maintenance is easy with VB Script because it can without difficulty trade the feature of constants.
Q11. Explain Few Date Functions In Vbscript?
Date(), Time(), Now(), Left(), Right(), Mid()
Q12. Write A Vbscript Procedure That Converts Feet To Inches. Hint: There Are 12 Inches In A Foot?
Option Explicit
Sub feet_to_inch() Dim Inches, Feet Feet=inputbox("Enter toes cost ") Inches = Feet * 12 MsgBox "There are " & Inches & " inches in " & Feet & " ft." End Sub Call feet_to_inch()
Q13. Why Is The Use Of Exit Do Or Exit For Statements Within Loops Discouraged?
These statements are acceptable for unique situations, however they often make code much less readable, which makes it hard for others who study your code to understand what is sincerely occurring. If you make sure the handiest manner out of a loop is to now not fulfill the loop's circumstance, it's much less difficult to observe your code. Often, breaking out of a loop by means of force with an go out assertion is a sign of a poorly built loop with a condition that does not meet your dreams. Take a examine the loop shape and situation once more to ensure you're not leaving something out.
Q14. Explain About .Wsf Files?
.Wsf documents are modeled in just like XML. They may be finished with the assist of Wscript.Exe and it can be executed from the command line also. This .Wsf file may have a couple of visual simple documents. Reuse functionality is present with this extension document.
Q15. How To Open Excel In Vb Script?
Set xl=createobject(“excel.Software”) set wb=xl.Workbooks.Open(“d:/sample.Xls”) set ws=wb.Worksheets(1) ws.Cells(three,four)=”welcome” wb.Save wb.Near set wb=nothing set ws=nothing set xl=nothing
Q16. Which Object Provide Information About A Single Runtime Error In A Vbscript?
Err Object.
Q17. What Is Event Handling In Vbscript?
The moves which might be carried out with the aid of clicking, urgent keys, shifting mouse, dragging and dropping etc are referred to as as activities. Event managing is the way to seize these activities and carry out the actions accordingly.
Q18. Explain Vbscript In Detail?
This is a scripting language developed via Microsoft and is primarily based loosely on Visual Basic. Its functionality in a web surroundings is defendant upon both an ASP engine or the Windows Scripting Host, and must be used on a Windows web hosting platform.
Q19. What Are The Data Types Supported By Vbscript?
VBScript has only one information kind referred to as a Variant. There are special categories of records that may be contained in a Variant, known as subtypes. These subtypes are:
Empty, Null, Boolean, Byte, Integer, Long Single, Double, Date/Time, Currency , String , Object and Error.
Q20. Explain About Adodb.Move Class?
ADODB.Stream elegance can be used as string builder. VBScript string concatenation can be very expensive because of common reminiscence allocation features. Binary report and memory I/O operation is supplied by means of ADODB.Stream class. This is broadly used to convert bytes into string, and so forth.
Q21. Which Function Allows You To Instantiate An Object Given Its Programmatic Identifier Or Progid?
CreateObject feature.
Q22. What Is The Purpose Of On Error Resume Next Statement?
The On Error Resume Next announcement gives you some diploma of error dealing with by means of preventing software interruptions from runtime errors.
When an errors takes place, by means of the use of this declaration, the line of code containing the mistake is surely skipped over and the program continues.
On Error Resume Next statement does no longer accurate an mistakes, just forget about it, with out even displaying the mistake message.
The Statement basically has methods it's miles used. First to show off the script engine blunders checking:
On Error Resume Next
The second is to turn it on, thereby allowing the script engine to prevent execution of a script when an errors is encountered. Like so:
On Error Goto zero
Q23. How To Open A File. What Is The Perpose Of True And False Mode There?
How to examine from document and write into the record
set documents = createobject(“scripting.Filesystemobject”) set obj1=documents.Opentextfile(“d:file2.Txt”,2,proper) ‘ actual makes use of for ceating txt record set obj2=documents.Opentextfile(“d:file2.Txt”,1,false) ‘ false will not create any file obj1.Writeline(“write this line into record”) str=obj2.Readline msgbox str set documents=not anything
Q24. Explain About Tristate Constants?
Tristate constants can be used with features which permit formatting of numbers. These constants can be used with VB Script with out defining them. It may be used everywhere in the code to reflect and constitute the values.
Q25. Explain Some Uses Of Vb Script?
If functionality element is considered VB Script acts much like Java Script however it's far compatible simplest on internet explorer. They engage with Document item model. Visual primary script also can be used for server side processing with ASP.
Q26. What Are String Functions In Vbscript?
Asc() - Returns ANSI Character Code Chr() - Returns Character from ANSI Code InStr() - Find a string inside some other InStrRev() - Find a string inside every other (Reverse) LCase() - Convert a string to lowercase Left() - Crops a string from left Len() - Determine the duration of a string LTrim() - Remove leading areas from a string Mid() - Crops a string Replace() - Replace a substring within a string Right() - Crops a string from right RTrim() - Remove trailing spaces from a string Space() - Creates a string with the specified number of areas StrComp() - Compare two strings String() - Creates a repeated character string StrReverse() - Reverse the characters of a string Trim() - Remove both leading and trailing areas from a string UCase() - Convert a string to uppercase
Q27. Compare Java Script And Vb Script?
VB and Java Script are a great deal similar in capability. They each engage with the record object model of the web page. Many browsers fit with Java Script however they're now not well matched with VB script as such. For client aspect scripting developers using VB Script should constantly make sure of go browser compatibility which is not the case whilst running with VB script.
Q28. By Default In Vbscript The Arguments Passed To Functions And Subroutines Are By Reference Or By Value?
By default, arguments are handed to features and subroutines by way of reference; this is, the address of the argument is provided to the function or subroutine.
Q29. What Is Difference Between Vbscript And Vba?
VBScript is a subset of Visual Basic for Applications, however there are still many differences:
VBScript doesn't have a debugger like Visual Basic or you can say that VBScript does not offer any debugging functions.You'll inn to the usage of plenty of message packing containers, as an alternative.
Unlike Visual Basic and Visual Basic for Applications, wherein the developer can outline the information sort of a variable in advance, all variables in VBScript are variants.
There isn't any included development surroundings for VBScript that parallels the IDE for Visual Basic and Visual Basic for Applications.
Because variables are untyped and code is not compiled, all external objects instantiated in VBScript code are always overdue-bound. This has some of implications. First, overdue binding generally involves a tremendous overall performance penalty in contrast to early binding. Second, at the same time as the properties and methods of early-sure gadgets can be tested in Visual Basic or hosted VBA environments the use of the Object Browser, this isn't always the case with past due-bound objects. Finally, the help centers to be had for early-sure items in VB and VBA (like Auto List Members and Auto Quick Info) are not available, making syntax errors more likely and geared up get right of entry to to correct documentation all the extra vital.
Q30. What Is The Difference Between A Dictionary And An Array?
A dictionary cannot be multidimensional but an array can be.
A dictionary has extra techniques to add new gadgets and take a look at for current items.
When you delete a specific item from a dictionary, all the subsequent objects robotically shift up. For example, if you delete the second one item in a 3-item dictionary, the original third object routinely shifts up into the second one-object slot.
Q31. What Is Dictionary Object In Vbscript? Explain?
The Dictionary object shops call / fee pairs (referred to as the important thing and item respectively) in an array.
Write the underneath code in a notepad and shop it with a .Vbs extension and run it from Command Prompt by just typing the name of the file.
Dim Beers
Set Beers = CreateObject("Scripting.Dictionary") Beers.Add "a", "Strauss" Beers.Add "b", "Kingfisher" Beers.Add "c", "Budweiser" Msgbox ("The cost similar to the key'b'is"&Beers.Item("b"))
The Dictionary item has many residences like Count, Item, CompareMode and so on and plenty of methods like Exists, Add, and Keys etc.
Q32. Explain Different Types Of Segment?
There are four types of segments utilized in Oracle databases:
data segments
index segments
rollback segments
transient segments
Data Segments:
There is a unmarried facts section to maintain all of the information of each non clustered desk in an oracle database. This information phase is created when you create an object with the CREATE TABLE/SNAPSHOT/SNAPSHOT LOG command. Also, a records section is created for a cluster when a CREATE CLUSTER command is issued. The storage parameters manipulate the manner that its data segment's extents are allotted. These affect the efficiency of facts retrieval and garage for the information phase related to the object.
Index Segments:
Every index in an Oracle database has a unmarried index phase to maintain all of its facts. Oracle creates the index phase for the index when you issue the CREATE INDEX command. Setting the storage parameters immediately affects the performance of information retrieval and storage.
Rollback Segments:
Rollbacks are required when the transactions that have an effect on the database want to be undone. Rollbacks are also wished during the time of gadget disasters. The way the roll-sponsored information is stored in rollback segment, the statistics can also be redone that is held in redo phase.
A rollback section is a portion of the database that records the moves of transactions if the transaction ought to be rolled lower back. Each database carries one or extra rollback segments. Rollback segments are used to offer study consistency, to rollback transactions, and to recover the database.
Types of rollbacks:
statement stage rollback
rollback to a savepoint
rollback of a transaction because of consumer request
rollback of a transaction due to unusual system termination
rollback of all exquisite transactions when an instance terminates abnormally
rollback of incomplete transactions during restoration.
Temporary Segments:
The SELECT statements want a temporary storage. When queries are fired, oracle wishes area to do sorting and different operation due to which brief storages are beneficial.
The commands which could use temporary storage when used with SELECT are:
GROUP BY, UNION, DISTINCT, and so on.
Q33. What Are The Different Types Of Operators And Their Order Of Precedence?
Order of evaluation of operators is, first arithmetic operators are evaluated, and assessment operators are evaluated next and on the final logical operators are evaluated at the last. In mathematics operators negation, Exponentiation, multiplication and department, integer department, modulus arithmetic, addition and subtraction and string concatenation are provided.
Q34. Explain Few Date Functions In Vbscript?
Date(), Time(), Now(), Left(), Right(), & Mid()
Q35. What Is The Function Of Smon?
The SMON heritage system performs all gadget tracking capabilities at the oracle database.
Each time oracle is re-began, SMON performs a heat start and makes certain that the transactions that were left incomplete at the final shut down are recovered.
SMON plays periodic cleanup of transient segments which might be no longer wanted.
Q36. What Is The Difference Between Function And Procedure?
A feature, that is known as differently from a subroutine, returns a cost to the code that calls it, even as a manner (subroutine) does now not. Functions must be set same to a go back fee:
Variable_1 = My_Function(A, B, C)
A subroutine, alternatively, isn't always set to a variable. It can be known as like
My_Subroutine A, B, C
Or
Call My_Subroutine(A, B, C)
Q37. Explain About The Functionality Of Vb Script?
Active X era can be used to present lots extra functionality to VB Script. VB presents sub workouts, capabilities, string manipulation, statistics/time, error managing, and many others. VB will have more functionality delivered to it by way of working with languages along with ASP.
Q38. Explain About The Support Of Asp For Vb Script Functionality?
Visual Basic need to rely upon ASP for sever side processing. Asp.Dll is used to make VB Script run on ASP engine and it invokes vbscript.Dll. VB Script must be embedded with in <% and %> context switches. ASP can provide varied functionality to VB Script.
Q39. Which Command Is Used For Writing Text On A Page?
Document.Write (textual content).
Q40. Explain About Vb Script?
VB script is a Microsoft programming language and it resembles a decrease model of the VB. It is an Active Scripting language. This scripting language is included in windows working gadget by way of default. With the usage of msscript.Ocx you could deploy VB Script.
Q41. What Is Variant In Vb Script?
Variant is the handiest datatype in vb script.There are many subtypes under variation.They are Empty, Null, Boolean, Byte, Integer, Currency, Long, Single, Double,Date, String, Object, Error.
Q42. If Else For Do While Select In Vb Script?
I=five j=6 if i>j then msgbox i elseif i msgbox j
else
msgbox “not anything”
end if
for i=5 to ten step 2
msgbox i
subsequent
do while i<15
msgbox i
i=i+three
loop
mycase=”gitam”
pick case mycase
case “abcd”
msgbox “abcd”
case mycase
msgbox mycase
case else
msgbox “wrong”
quit choose
Q43. What's The Difference Between Vbscript And Vb.Net?
VBScript is script - a text-based totally code that receives interpreted by means of a "host", just like the Windows Script Host or IE. VB.Net is a semi-compiled language for writing java-like software program.
Q44. What Aspects Of Vbscript Make It Safe So That A Web Page Using Vbscript Cannot Destroy Or Corrupt Information On A User's Computer?
The VBScript code that comes along in a Web web page can not without delay get right of entry to any documents at the consumer's computer. This prevents a Web page from making any changes to sensitive files at the person's laptop. VBScript is also very safe in that it doesn't provide programmers the potential to create unrecoverable crashes with the aid of distinctive feature of its language syntax.
Q45. What Is Sql Loader? Explain The Files Used By Sql Loader To Load File?
SQL*Loader is a bulk loader utility used for transferring information from outside files into the Oracle database. SQL*Loader helps various load formats, selective loading, and multi-table hundreds. When a control document is fed to an SQL*Loader, it writes messages to the log file, terrible rows to the terrible report and discarded rows to the discard record.
Control report:
The SQL*Loader manage file incorporates information that describes how the data might be loaded. It contains the table call, column datatypes, field delimiters, and so on.
Controlfile.Square must be used to generate an accurate manage record for a given table.
Log File:
The log document carries facts approximately the SQL*loader execution. It must be considered after each SQL*Loader job is entire.
Q46. What Is The Difference Between Vb Debugger And The Script Debugger?
Difference among VB Debugger and the Script Debugger:
No "at the fly" modifying
Because the scripting window is examine-only, you cannot edit the code in the course of execution, as you could maximum of the time with VB.
No Instant Watch (Shift-F9)
The VB debugger's immediate watch facility, which allows you to spotlight a variable in your code, press Shift-F9, and notice the fee of the variable, isn't available in the Script Debugger.
Cannot set watches Watches do not exist in the Script Debugger.
Cannot set the subsequent announcement Using the VB Debugger, you may area the cursor on a line of code and, by using clicking CTRL-F9, have application execution resume at that line. This is specially beneficial to backpedal or to re-execute a section of code. Unfortunately, this option isn't always available inside the Script Debugger.
Q47. How To Open Browser In Vb Script?
Set ie=createobject(“internetexplorer.Utility”) ie.Navigate(“http://www.Google.Co.In/”) ie.Seen=proper set ie = nothing
Q48. Assume You Have A Variable Called Age That Contains An Age Provided By The User. Write The Code That Ensures That The User Has Entered A Number As Her Age. If The User Hasn't Entered A Number, Tell He
If IsNumeric(Age) = False Then
MsgBox "The size need to be more than a few. Please kind it once more." End If
Q49. Explain About The Asc Function?
According to the first letter in a string it returns the ANSI code applicable to that first letter. If string is not gift then a runtime error occurs. Asc function returns the primary byte used. It is used handiest with elements containing byte statistics in a string.
Q50. Explain About Filter Expression?
Filter expression returns an array primarily based on a selected clear out search condition and it returns a zero based totally array. Arguments included in the clear out array are Input strings, price, consist of and evaluate. If there's no in shape for the cost it returns an empty string.

