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

How to supress warnings from the "Test results page"?

6 Answers   BirlaSoft,


What In-string function will do?

1 Answers  


Diff b/w Health care domain and Banking Domain?

0 Answers  


I recorded a Web App with a Oracle backend using QTP 9.5 and for some reason the scripts don't play back> What am I missing at this point. I recorded the same Apps under Sybase and they work great. This is Oracle 10g. Why won't my scripts play back.

0 Answers  


How to do the scripting. Is there any inbuilt functions in QTP as in QTP-S. Whatz the difference between them? how to handle script issues?

2 Answers  






How to call .vbs functions in QTP? plz Explain indetail

4 Answers   Wipro,


How to use Regular Expressions in QTP

1 Answers  


I am not able to record yahoomail browser.its giving error like "The browser Application can't be launched .Posssibly the URL is wrong" So anyone can tell me what setting i have to do in qtp??

1 Answers  


Hi, I am supposed to automate mainframe application through qtp. I do not know how to start abt it. Can you plz help me in first initializing the process or do you anybody have a guide book or a link which guides me through the process of automating the mainframe applications and things involved in it.

0 Answers  


how to use import and export sheet methods in qtp

1 Answers  


how to retrieve the value from data table to the script and using the value to be displayed in message box. an also retrieve the value of the output value during runtime to the script or separating and using that value in the script.

1 Answers  


What is keyword view and Expert view in QTP?

9 Answers   Ordain Solutions,


Categories