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 |
how to associate object repository during runtime in qtp
hi radhaka plz tell me clearly to handle the earrors with out isng recovery scnerio this is sreenivas from delhi
If created one virtual object? Next time I changed the window position will it work?
What is the ur roles and responsibilities as automation testing engineer?
How to Import data from a ".xls" file to Data table during Runtime.
How do you configure QTP AND Test director?
what is exit and entry criteria of automation testing. any body wants a real time script,please mail to me. contactno;9986435766
What is output value?
What are the Latest Feature are added In QTP 9.2?
Hi, I want to retrieve the cell data in the WebTable. For that I have defined a new test object under the browser and have given html tag and text as the test object properties. But while I try to identify it it says 'Object description is not unique'. I tried adding innerhtml, outerhtml, innertext and outertext along with the ordinal identifiers; but no use. What more properties need to be added to identify it? Also I want to enable smart identification for this object but the field is disabled in the object repository for this object alone(In QTP tools->object identification the enable smart identification checkbox is enabled). How do I enable it?
One build is delivered. in that build button name is submit. but in the next buit that name of the button changed as login.are u continue with previous recorded script or u make any changes?
Did QTP prove efficient for your project? Yes or No, explain?