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

What are the different types of checkpoints?

577


1.Write a CRITICAL test cases for calculator ? 2.What is the difference b/w FRS and SRS documents ? 3.What is Component ? 4.What is object ? 5.what is the difference b/w static and dynamic descriptive programming ?

1574


what is the difference betn QTP 8.0 AND PREVIOUS VERSION

1949


Differences between text and test area checkpoints?

572


This is a question thats generally asked in every QTP interview. What were the problems that you faced during automation and how did you resolve them?

1463






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

3268


How does you pass optional arguments in qtp?

559


What is test object model in quicktest professional?

617


What is difference in global and action sheet in qtp?

602


Explain types of descriptive programming?

587


What is contained in the object repository?

609


When do go for loop condition in test?

654


How to get the format of a webedit class in qtp. How can i know that particular webedit accept what type of format like "mm/dd/yyyy" or "$" or Alphanumeric

1637


what type of run time errors you get while you ar edoing rpg program?

1506


How can i initiate the objects to find uniquely in OR

1460