VB Script interview questions for experienced/VBScript Interview Questions and Answers for Freshers & Experienced

What Is The Difference Between A Dictionary And An Array?

A dictionary can not be multidimensional but an array can be.A dictionary has greater techniques to add new items and test for existing objects.When you delete a specific object from a dictionary, all the subsequent gadgets mechanically shift up. For example, in case you delete the second one item in a 3-object dictionary, the authentic 0.33 object mechanically shifts up into the second one-item slot.

Posted Date:- 2021-09-23 09:11:00

What Is Dictionary Object In Vbscript? Explain?

The Dictionary item shops name / price pairs (known as the key and item respectively) in an array.

Write the underneath code in a notepad and save it with a .Vbs extension and run it from Command Prompt with the aid of simply typing the name of the document.

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 important thing'b'is"&Beers.Item("b"))
The Dictionary object has many properties like Count, Item, CompareMode etc and plenty of strategies like Exists, Add, and Keys and so on.

Posted Date:- 2021-09-23 09:08:35

By Default In Vbscript The Arguments Passed To Functions And Subroutines Are By Reference Or By Value?

By default, arguments are exceeded to features and subroutines via reference; this is, the cope with of the argument is furnished to the feature or subroutine.

Posted Date:- 2021-09-23 09:06:59

Is Vbscript A Case-touchy 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 to the equal variable.

Posted Date:- 2021-09-23 09:04:34

How To Open Excel In Vb Script?

set xl=createobject(“excel.Utility”)
set wb=xl.Workbooks.Open(“d:/pattern.Xls”)
set ws=wb.Worksheets(1)
ws.Cells(three,4)=”welcome”
wb.Shop
wb.Near
set wb=nothing
set ws=not anything
set xl=not anything

Posted Date:- 2021-09-23 09:03:02

What Are The Different Types Of Operators And Their Order Of Precedence?

Order of assessment of operators is, first arithmetic operators are evaluated, and evaluation operators are evaluated subsequent and on the final logical operators are evaluated at the closing. In mathematics operators negation, Exponentiation, multiplication and division, integer division, modulus arithmetic, addition and subtraction and string concatenation are furnished.

Posted Date:- 2021-09-23 09:01:50

Explain About Adodb.Flow Class?

ADODB.Stream class may be used as string builder. VBScript string concatenation may be very luxurious due to common memory allocation functions. Binary document and reminiscence I/O operation is provided by ADODB.Stream magnificence. This is broadly used to convert bytes into string, etc.

Posted Date:- 2021-09-23 09:01:02

how to open a file .What is the perpose of true and false mode there

How to read from file and write into the file

set files = createobject(“scripting.filesystemobject”)

set obj1=files.opentextfile(“d:file2.txt”,2,true) ‘ true uses for ceating txt file



set obj2=files.opentextfile(“d:file2.txt”,1,false) ‘ false will not create any file

obj1.writeline(“write this line into file”)

str=obj2.readline

msgbox str

set files=nothing

Posted Date:- 2021-09-23 08:58:42

Explain about Tristate constants?

Tristate constants can be used with functions which allow formatting of numbers. These constants can be used with VB Script without defining them. It can be used anywhere in the code to reflect and represent the values.

Posted Date:- 2021-09-23 08:57:43

Explain about ADODB.Stream class?

ADODB.Stream class can be used as string builder. VBScript string concatenation can be very costly because of frequent memory allocation features. Binary file and memory I/O operation is provided by ADODB.Stream class. This is widely used to convert bytes into string, etc.

Posted Date:- 2021-09-23 08:57:05

What purpose does ‘On Error Resume Next’ serves?

On Error Resume Next moves the control of the cursor to the next line of the error statement i.e. if any runtime error occurs at any particular line in the script then the control will move into the next line of the statement where the error has occurred.

Posted Date:- 2021-09-23 06:31:59

Why is Error handling required?

You can take measures to get minimum number of errors as possible by making use of Error Handling Mechanism in your scripts. Situations like issues in mathematical computations or any type of error can be handled with the help of Error Handling.

Posted Date:- 2021-09-23 06:31:29

What methods are used to create text files and open text files in the VBScript language?

CreateTextFile and OpenTextFile methods are used to create open text files and open text files respectively in the VBScript language.

Posted Date:- 2021-09-23 06:30:08

What is the use of the RecordSet object and which statement is used to create such an object?

The RecordSet object is used for holding the records of the query which are extracted from the database.

Set obj = createobject(“ADODB.RecordSet”) is the statement for creating a RecordSet object.

Posted Date:- 2021-09-23 06:29:36

Which Opearator Can Be Used To Do An Xor Operation In Vbscript?

XOR Called Logical Exclusion operator. It is used to do an XOR operation.

Example:

A. Dim a : a = 5
Dim b : b = 10
Dim c
c = b XOR a
Document.write ("XOR Check is " &c)

Posted Date:- 2021-09-23 06:28:02

How Regexp.execute Method Works?

The Execute method works like Replace, except that it returns a Matches collection object, containing a Match object for each successful match. It doesn't modify the original string.

Posted Date:- 2021-09-23 06:26:52

Why is it recommended to close the database connection every time after the work is completed?

This is a very important Interview Question which has been asked many times.

It is recommended to close the resource after its usage is completed although it’s not mandatory as library or driver ultimately will close the connection but this is required to avoid any negative effects due to improper closing of the connections which can even lead to a restriction in the access of the database by some of the users.

Posted Date:- 2021-09-23 06:26:20

What is the use of the ‘Open’ method to work with the database in the VBScript language and what connection string is passed in the same and what is its usage?

This is used to open a database connection object/recordset object.

obj.Open“Provider=SQLQLEDB;Server=.SQLEXPRESS;UserId=test;Password=P@123;Database =AUTODB” is the connection string for opening a database connection.

The connection string is a very useful property and this is used for creating a database connection and includes connection information like details of the Driver, Database Server Name, Username, and Password.

Posted Date:- 2021-09-23 06:25:47

Which object is used to work with the database in the VBScript language and what statement is used to create this object?

Connection Objects provide supports to the Coders to work and deal with the database. As such, there is not any straight-forward mechanism to connect to the database in QTP but by making use of ADODB Objects, you can interact with the database and work with the SQL Queries to fetch the data from the database.

ADO stands for ActiveX Data Objects and this provides a mechanism to act as an intermediary between the QTP and the Database.

Set obj = createobject(“ADODB.Connection”) is the way to create a Connection Object.

Posted Date:- 2021-09-23 06:25:18

Which object is used to work with the excel sheets in the VBScript language and what statement is used to create this object?

Excel Objects provide supports to the coders to work and deal with the Excel Sheets.

Set obj = createobject(“Excel.Application”) is the way to create an Excel Object.

Posted Date:- 2021-09-23 06:24:45

When does ‘On Click of Button’ event gets triggered in the VBScript language?

This Event occurs in case of the clicking of any button that is present on any HTML page.

Posted Date:- 2021-09-23 06:24:10

How Will You Trim The Spaces On The Left Of A String Using Vbscript?

Using Ltrim function, which returns a string after removing the spaces on the left side of the specified string.

Posted Date:- 2021-09-23 06:23:44

What Is The Output Of A + B In Vbscript If A = "vb" And B = "script"?

+ operator concatenates two Values if values are string. So A + B will give VBScript.

Posted Date:- 2021-09-23 06:23:18

Which Event is triggered when mouse focus comes out of an element in the VBScript language?

MouseOut Event is triggered when mouse focus comes out of an element in the VBScript language.

Posted Date:- 2021-09-23 06:22:51

Explain about the Asc function?

According to the first letter in a string it returns the ANSI code relevant to that first letter. If string is not present, then a runtime error occurs. Asc function returns the first byte used. It is used only with elements containing byte data in a string.

Posted Date:- 2021-09-23 06:22:08

Explain about the extension .hta?

.hta extension is used whenever you want to include a VB script in HTML. Here HTML acts as an interface and VB Script as the programming language. .hta extension files do run in the safe and trusted zone of Internet explorer. Although they run in the trusted zone querying is restricted as it has to pass the guidelines of internet explorer.

Posted Date:- 2021-09-23 06:21:18

Explain about .wsf files?

wsf files are modeled in similar to XML. They can be executed with the help of Wscript.exe and it can be done from the command line also. This .wsf file can have multiple visual basic files. Reuse functionality is present with this extension file.

Posted Date:- 2021-09-23 06:20:55

Give examples where VB script can directly run on user’s system with Windows as OS?

A simple example detailing the running of VB Script is by utilizing Windows Script host environment. Visual basic is a standalone application which has a .vbs as extension. Input can be provided through graphical user interface and output can be obtained by Wscript.exe from dialog and input boxes. From command line it can be invoked by Cscript. exe.

Posted Date:- 2021-09-23 06:19:11

How can you fetch the value of a Cookie?

document.cookie stores the information of key-value pairs and expiration date values of a Cookie.

document.cookie = “key1=name of the value1;key2=name of the value2,…….,expires=date”.

‘;’ is used to separate the key-value pairs.

Posted Date:- 2021-09-23 06:13:52

How can the spaces from the string be removed?

Trim function is used to trim/remove the spaces from both the sides of the specified String.

Syntax: Trim(name of the string).

Posted Date:- 2021-09-23 06:12:17

How Will You Get The Natural Logarithm Of The Given Number In Vbscript?

Using Log function, which returns the natural logarithm of the given number.

Example:

Dim num : num = 210
document.write("Log Result of num2 is : " & Log(num2))& "<br/>" '5.34710753071747

Posted Date:- 2021-09-23 06:11:15

How Will You Get The Last Occurrence Of One String Within Another String Using Vbscript?

Using InStrRev function, which returns the first occurrence of one string within another string. The search happens from right to left.

Posted Date:- 2021-09-23 06:10:49

Which function is used to perform string comparison?

StrComp is used to compare the 2 strings and return values on the basis of the comparison. This returns 0 if string1 = string2,-1 if string1<string2,1 if string1>string2 and null if any of the strings is null.

Syntax: StrComp(name of the string1, name of the string2).

Posted Date:- 2021-09-23 06:10:26

What Is Sql Loader? Explain The Files Used By Sql Loader To Load File?

SQL*Loader is a bulk loader utility used for moving data from external files into the Oracle database. SQL*Loader supports various load formats, selective loading, and multi-table loads. When a control file is fed to an SQL*Loader, it writes messages to the log file, bad rows to the bad file and discarded rows to the discard file.

Control file:

The SQL*Loader control file contains information that describes how the data will be loaded. It contains the table name, column datatypes, field delimiters, etc.

controlfile.sql should be used to generate an accurate control file for a given table.

Log File:

The log file contains information about the SQL*loader execution. It should be viewed after each SQL*Loader job is complete.

Posted Date:- 2021-09-23 06:10:05

What Is The Function Of Smon?

The SMON background process performs all system monitoring functions on the oracle database.
Each time oracle is re-started, SMON performs a warm start and makes sure that the transactions that were left incomplete at the last shut down are recovered.

SMON performs periodic cleanup of temporary segments that are no longer needed.

Posted Date:- 2021-09-23 06:09:22

Why Is The Use Of Exit Do Or Exit For Statements Within Loops Discouraged?

These statements are acceptable for specific conditions, but they often make code less readable, which makes it difficult for others who look at your code to know what's really going on. If you make sure the only way out of a loop is to not satisfy the loop's condition, it's much easier to follow your code. Often, breaking out of a loop by force with an exit statement is a sign of a poorly constructed loop with a condition that does not meet your goals. Take a look at the loop structure and condition again to make sure you're not leaving something out.

Posted Date:- 2021-09-23 06:08:58

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 page cannot directly access any files on the client's computer. This prevents a Web page from making any modifications to sensitive files on the user's computer. VBScript is also very safe in that it doesn't give programmers the ability to create unrecoverable crashes by virtue of its language syntax.

Posted Date:- 2021-09-23 06:08:36

How to get the length of the string by making use of the String function?

Len function is used to get the length of a specified string i.e. the total number of characters of a specified String.

Syntax: Len(name of the string).

Posted Date:- 2021-09-23 06:08:14

Which function is used in the VBScript language to convert the specified expression into a Date type value?

cDate is used to convert a valid expression into a Date type value. The syntax of this is cDate(date) i.e. any valid Date/Time expression will be converted into a particular Date.

Posted Date:- 2021-09-23 06:07:49

What is the use of the FormatDateTime function in the VBScript language?

This is a format function which is used to convert the Date to some specific format based on the parameters that are supplied to the function. The syntax of this is FormatDateTime(Date, Format). This is a widely used format function.

Posted Date:- 2021-09-23 06:07:29

Which Date function is used in the VBScript language to find the difference between the 2 dates?

DateDiff function is used to fetch the difference between the 2 dates that are specified as parameters on the basis of the interval specified.

Posted Date:- 2021-09-23 06:07:01

When are REDIM statement and PRESERVE keyword used in the VBScript language?

This is a very important Interview Question that has been asked many times.

REDIM statement is used to re-define the size of an array. When the array is declared without any size, an array can be declared again using REDIM with the feasibility of specifying the size of an array.

PRESERVE keyword is used to preserve the contents of a current array when the size of an array gets changed.

Posted Date:- 2021-09-23 06:06:32

What Is The Purpose Of On Error Resume Next Statement?


The On Error Resume Next statement provides you some degree of error handling by preventing program interruptions from runtime errors.

When an error occurs, by using this statement, the line of code containing the error is simply skipped over and the program continues.

On Error Resume Next statement does not correct an error, just ignore it, without even displaying the error message.

The Statement essentially has two ways it is used. First to turn off the script engine error checking:

On Error Resume Next

The second is to turn it on, thereby allowing the script engine to stop execution of a script when an error is encountered. Like so:

On Error Goto 0

Posted Date:- 2021-09-23 06:06:02

What Is The Difference Between A Dictionary And An Array?


A dictionary can't be multidimensional but an array can be.

A dictionary has extra methods to add new items and check for existing items.

When you delete a particular item from a dictionary, all the subsequent items automatically shift up. For example, if you delete the second item in a three-item dictionary, the original third item automatically shifts up into the second-item slot.

Posted Date:- 2021-09-23 06:05:21

Which In-Built function related to an Array joins substrings into one string in the VBScript language?

Join function combines multiple substrings into a String. Here, the string returned value includes various substrings in an array and thus joins all the substrings into one string.

Syntax: Join(array,[delimiter]. Using delimiter is an optional condition.

Posted Date:- 2021-09-23 06:04:13

What are lbound and ubound in the VBScript language?

lbound indicates the smallest subscript or index of an Array in the VBScript language and this always returns 0, as the index value of an Array always starts from 0.

ubound returns the largest subscript of a defined array or can say it indicates the size of an Array. If the size of an array is 5 then the value of the ubound is 5.

Posted Date:- 2021-09-23 06:03:59

Which In-Built functions are used to convert the specified expression in the form of Date and String in the VBScript language?

cDate is one of the frequently used conversion functions for converting the expression which includes Date or Time parameter into Date subtype.

cStr is the conversion function which is used for converting the expression into the String subtype.

Posted Date:- 2021-09-23 06:03:41

What are the 2 ways to pass a value to the Function?

The 2 ways to pass a value to the function are:

* Pass by Value: When arguments are passed and any changes that take place in the Called procedure in the value of a variable does not persist then it means it is passing by value. The keyword used in this case is ByVal.

* Pass by Reference: When arguments are passed and any changes that take place in the Called procedure in the value of a variable persist then it means it is passing by reference. The keyword used in this case is ByRef.

Posted Date:- 2021-09-23 06:03:09

How many types of Procedures are available in the VBScript language?

There are 2 types of Procedures in the VBScript language – Sub Procedures and Function Procedures.

Sub is a type of procedure that includes a set of statements inside the block of the code and after execution, it does not return any value.

The Function is a type of procedure that includes a set of statements inside the block of the code and after execution, it may return value also. This can take input if required, depending on the situation.

Posted Date:- 2021-09-23 06:02:15

What is the difference between Do Until Loop and Do While Loop?

Do While Loop first checks the condition and if it is true only after that the statements are executed and in case of Do Until, the loop will be executed until the condition becomes false.

Posted Date:- 2021-09-23 06:01:59

Search
R4R Team
R4R provides VBScript Freshers questions and answers (VBScript Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,VB Script interview questions for experienced,VBScript Freshers & Experienced Interview Questions and Answers,VBScript Objetive choice questions and answers,VBScript Multiple choice questions and answers,VBScript objective, VBScript questions , VBScript answers,VBScript MCQs questions and answers R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for VBScript fresher interview questions ,VBScript Experienced interview questions,VBScript fresher interview questions and answers ,VBScript Experienced interview questions and answers,tricky VBScript queries for interview pdf,complex VBScript for practice with answers,VBScript for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .