what is the Vbscript to connect Database

Answers were Sorted based on User's Feedback



what is the Vbscript to connect Database..

Answer / ravi_kanakam

Check this............

Function db_connect( byRef curSession ,connection_string)
dim connection
on error resume next
' Opening connection
set connection = CreateObject("ADODB.Connection")
If Err.Number <> 0 then
db_connect= "Error # " & CStr(Err.Number) & " " &
Err.Description
err.clear
Exit Function
End If

connection.Open connection_string
If Err.Number <> 0 then
db_connect= "Error # " & CStr(Err.Number) & " " &
Err.Description
err.clear
Exit Function
End If
set curSession=connection
db_connect=0
End Function

Is This Answer Correct ?    9 Yes 1 No

what is the Vbscript to connect Database..

Answer / paayal

VBScript function that you can use to conncet to DB is
CreateObject. we have to create the connection object first
as ADODB and then we can use that connection object to open
the DB connection. Once the connection is open, we can run
SQL query by using a while..wend loop and can get the
derired results data into local data sheet

Is This Answer Correct ?    3 Yes 1 No

what is the Vbscript to connect Database..

Answer / purshottam swarnkar

function Connect database
set con= create object("Adodb.Connection")
set rs=create object("Adodb.Recordset")
con.provider = "microsoft.jet.OLEDB.4.0" '@ For MS access
con.open="Path of Database"
rs.open "select * from xxxx", con
do until re.eof
end function

Is This Answer Correct ?    1 Yes 0 No

what is the Vbscript to connect Database..

Answer / shubhang

I guess this will work out.

Set con = CreateObject("ADODB.Connection")
con.provider = "XYZ"
con.username ="XYZ"
con.password = "XYZ"
con.protocol = "XYZ"
con.port = "XYZ"

RS=con.execute "Select * from ABC"

do while rs.EOF <>True

Is This Answer Correct ?    0 Yes 1 No

what is the Vbscript to connect Database..

Answer / ajreddy

function Connect database
set con= create object("Adodb.Connection")
set rs=create object("Adodb.Recordset")
con.provider = "microsoft.jet.OLEDB.4.0" '@ For MS access
con.open="Path of Database"
rs.open "select * from xxxx", con
do until re.eof
end function

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More QTP Interview Questions

There are 3 types of frame works in QTP 1. Linear frame work 2. Modular frame work 3. Key word driven frame work. Can any body explain the above 3 frame work models. y2k_ram2000@yahoo.com

6 Answers   Fidelity, GDS, IBM, TCS, Wipro,


How to use library files in QTP? how we can call these files in to script?

4 Answers   Virtusa, Wipro,


ACTUALLY I AM WORKING IN THE DISTRIBUTION DOMAIN.MY COMPANY IS PROVIDING DISTRIBUTION SOFTWARE FOR PHARMA AND FMCG DISTRIBUTORS.HERE I AM USING QTP 9.2.HERE IN MY APPLICATION WHILE RECORDING ONE WINDOW APPEARS.IN THAT I CAN SELECT THE ITEM OR NO NEED TO SELECT.BUT WHILE RUNNING THE SAME SCRIPT THE WINDOW MAY NOT APPEAR OR APPEAR.HOW TO WRITE SCRIPT FOR THIS

0 Answers  


tell me types of environment variables? what r they? explain details? pls give anwer any one?

2 Answers   IBM,


I am new to automation testing.I am learning QTP 9.2.my question is how to install the defferent addins(other than Default Addins) is there any defference in QTP after installing the Addins.where we can get the addins?

0 Answers  






Which scripting language used by QTP?

1 Answers  


What is the advantage of associating a procedure with a test object?

1 Answers  


What is meant by Environmental variables?2 types r there know…can u pls explain clearly?

1 Answers  


If you have two monitors one is of 19inch and the 2nd one is of 24inch,if you want to write same QTP script in both the two monitors is there any changes required in the script?

0 Answers   Infosys,


If you are testing a web application then what will you test in that application?

0 Answers   Infosys,


how to test one edit box using Java addin for Web Applications? write script?

1 Answers   IBM,


Difference between action & Reusable action?

0 Answers  


Categories