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

Sometimes my QTP scripts works fine and sometimes its not though I am using same shared Repository and am not doing any changes in it.Even though for descriptive programming also its works fine and sometimes it does not work.my application is pretty stable.Could anyone please answer why am facing these types of issue??

1 Answers  


Where should we turn Smart Identification ON in QTP?

5 Answers  


Whenever we r keeping mouse pointer under the image we r getting image name. In qtp how can we do this thing.weather that name is coming or not?

5 Answers  


can anyone please tell me what are all the shortcut keys used for qtp9.2? Thanks in advance..i expect ur valuable reply that help us our team???

0 Answers  


how to test Web application using QTP software

0 Answers  






How we test web based application by using QTP

0 Answers  


How do you change Logical Name of the object in test script?

1 Answers   TCS,


How does qtp identify gui object?

0 Answers  


Hi to All, My name is Aditya, i have 4 year exp in software testing (Manual Testing), but i try to shift my career now in automation testing. right now i have no exp or u can say i am not hand exp in live application. So please guide me, what i do ???? Can i join again automation course only practical which is live application. if u know any person who's expert in qtp and he/she ready to take my class i have our own and company laptop. If required i will pay amount please don't mind. Please help me, and i am also planing to join core java from coming 1st Aust (in seed) for only purpose the understanding script of Automation (QTP)... Please help me... I am waitting u r replay... Thank you Thanks again

5 Answers  


what is the data driven testing?

0 Answers  


How to make arguments optional in a function?

1 Answers   IBM,


how to write testcases for web based insurance,from the script by using qtp.

1 Answers  


Categories