how to connect qtp to sqlserver?(if any body know about this please send mail to me:sheik_feroz5@yahoo.com)thank u

Answers were Sorted based on User's Feedback



how to connect qtp to sqlserver?(if any body know about this please send mail to me:sheik_feroz5@yah..

Answer / rajib

set conn=Createobject("ADODB.Connection")
Srvname="Driver=<>,Server=<>,UID=<>,Password=<>"
conn.open Srvname
Set Rec = CreateObject("ADODB.Recordset")
SQL="<SQL statement>"
Rec.open SQL ,conn

Is This Answer Correct ?    5 Yes 2 No

how to connect qtp to sqlserver?(if any body know about this please send mail to me:sheik_feroz5@yah..

Answer / mahaboob

set conobj=createobject("ADODB.connection")
conobj.open.provider"providername",Datasource="path of file",uid="username",pwd="password"

Is This Answer Correct ?    0 Yes 0 No

how to connect qtp to sqlserver?(if any body know about this please send mail to me:sheik_feroz5@yah..

Answer / sunita

Dim sServer, sConn, oConn, sDatabaseName

sDatabaseName = "Migrations"
sServer = "hyrdwsz0010"

Set oConn = CreateObject("ADODB.Connection")
oConn.Open "provider=sqloledb;data source=" & sServer & ";initial catalog=" & sDatabaseName &";Trusted_Connection=Yes;"
oConn.CommandTimeout = 0

Set oRs = oConn.Execute("Select * from dbo.CLIENTLISTSS")
Set RowCount= oConn.Execute("Select Count(*) from dbo.CLIENTLISTSS")
Msgbox FormatNumber(RowCount(0),0)
Msgbox oRs.Fields.Count
Msgbox oRs.Fields.item(1)
arraydata=oRs.GetRows
Msgbox arraydata(1,1)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

How do u write a regular expression for date (dd/mm/yyyy) field ?

4 Answers   Semantic Space,


How to apporach while starting the automation testing?

3 Answers   Patni,


can u expect, major bugs in NET BANKING Project? Modules Transaction Module, Customer Relation Module.

2 Answers  


How to write script to display a message box having the "Date" value of the fourth mail(yahoo account). I've tried it with the web table concept but the content doesn't get displayed? Please help me out to resolve this :-)

2 Answers  


If QTP not recognizing using repository while executing, how can we go forward

3 Answers  






Why bpt?

0 Answers  


What is the use of Testing framework in Automated testing..what are different kinds of Testing frameworks available in Automated testing...

1 Answers   IBM,


In QTP if u got a defect , how to report to developer using Test director or Quality center .

5 Answers   Wipro,


How you are maintaining shared object repository in your team or your project?help me plz

1 Answers   CTS,


Use of environment variables?

4 Answers  


How good are you in writing VBscript code for your application? Can you completely write VBscrit for your project with out using recording mode in QTP?

3 Answers   CTS,


In a web page, one web table is present which is dynamic. In that table one of the column has links with the same inner text. write a script so that i need to click the third link.

3 Answers  


Categories