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 |
What is difference between Recording time object identification and Run time (Execution) time.
Tell me the QTP Advantages and Disadvatages ?
What are the Levels of Automation in QTP
how to test power point using QTP 8.2 ? What are different methods to retrieve value from Application during runtime ?
I am Using QTP 9.1 version. I have created a Shared Object Repository. The size of Shared Object REpository is 9 MB. In my system i am able to execute the script very flexibly and it is very fast. But if i copy the same code into other system with the same configuration, it is executing very slowly(i.e dam slow). It is not happening in all machines it is in only some machines. Can please any one give th esolution. It is high priority to me as i need to give demo to client on their machines.
Explain getroproperty and gettoproperty & settoproperty?
Hi,All How to create a link in excel sheet using qtp
In QTP for .net application which plug in is used? For Java Application which plug in is used ?
2 Answers AppLabs, Fraze Tech,
hi gavasker i want how to merg OR's in QTP 8.2 by QTP Plus
Hi Guys, In one of my interviews, I was asked to Write a paragaraph explaining how much scripting I did in QTP? I don't know where to start and what to write. So I need your help in writing that.
what is the difference betn QTP 8.0 AND PREVIOUS VERSION
wht is the difference betn check point and output value?