what is the Vbscript to connect Database
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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?
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
tell me types of environment variables? what r they? explain details? pls give anwer any one?
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?
Which scripting language used by QTP?
What is the advantage of associating a procedure with a test object?
What is meant by Environmental variables?2 types r there know…can u pls explain clearly?
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?
If you are testing a web application then what will you test in that application?
how to test one edit box using Java addin for Web Applications? write script?
Difference between action & Reusable action?