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 |
If enter into interviewer room? how u introduce with him. with shakehand or waht?
How to get line numbers in your editor in expert view?
if there is a web table of having row and colmns.a button is placed at 2nd row's 3rd column which is worked for both edit and delete..how to write script for the button to test both operation on the web table using desriptive programing.. plz help me on script wheather using getroproperty Q2)what is the command for taking valiue from a web table in qtp
Why to use descriptive programming?
How many ways return more then one value from function?
I would like to directly import XL file and work on that XL file directly in QTp script in that XL sheet need to allocate workbench,XL sheet and generate two bar graphs automatically how to do that? plz let me know any answers?
In application which areas to be automated and what kind of situation will be take? using QTP? Plz give me the clear answer
0 Answers Tavant Technologies,
what happen in object repository(shared)if we call an existing action from an external action ? and what happen in object repository(peraction)if we call an existing action from an external action ?
Distinguish between manual testing and automation testing
How to add verification steps to tests?
Does QTP supports Linux or Unix OS?.If so which scripting is preferable? Shell we do record and playback
Is it possible for QTP to capture the objects in word document.If so please give me the code.Thank you.