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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Without integrating QC/Testdirector with QTP, is it possible to keep track of the defects?If yes how? How to export QTP results to an excel sheet?

1577


Hi friends I need to know about jubula automation tool. Is anybody know in bangalore where jubula tanning class is going on do let me know. Its urgent for me to learn that tool please help.

2992


Tell me one scenario, the complex functionality you have automated in your project?

1572


Can any one send me the QTP Basic Coding Samples?

1712


What are the methods used in UFT to handle exceptions or run-time errors?

747






hi i want license key for qtp 9.2 pls its adjust product name : quick test professional locking code :8 - 54A6A license type : seat license maintenance number : 88888888-8888 pls send license key to my email id borusu.ramkumar@gmail.com

3806


How do you test the text displayed in the header portion of times of india epaper. Hot news(banner) are scrolling in the top of the page, how do you test using QTP?

1597


What are the Disadvantages of shared object repository?

668


How to save your test using quicktest professional?

638


Explain quicktest professional (qtp) testing process?

635


Is there anyway to automatically update the Datasource name in Database Checkpoints object when we migrate tests to a new release?

3373


What is use of object spy?

697


Tell some commonly used Excel VBA functions?

706


For which type of projects the iterative model is not suitable?

1543


when u script reveiwing in which area u more concentrates?

1497