There is a table with 4 columns and 10 rows, how to write the
script to display the first column records using qtp? can
anybody help me with script?

Answer Posted / manas

Dim Conn, rs, ListOfRecords, x
' Connect to the Microsoft Access Database by createing a
object
set conn=CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/DataBase1.mdb" ' ex: Name of DataBase is
DataBase1.mdb

' Retriving data from Access using the SQL Query
' Column_name1 - Suppose first column
' Table - Suppose Name of Table
set rs=CreateObject("ADODB.recordset")
rs.Open "Select Column_name1 from Table", conn

for each x in rs.Fields
ListOfRecords = ListOfRecords & x.Column_Name1 & vbCrLf
next

MsgBox ListOfRecords

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to use userdifined environment variables.Once we created in Environment tab which is at File--> Settings-- >Environment-->Userdifined

1456


What are the five challenges you faced in QTP?

2742


What is an object repository?

591


How do you create regression test packs?

601


After executing the script in qtp suppose i found some script execute successfully and found some error.So how to report the status for both (i.e pass and fail report)in test director. For "fail" We use "defect tab" in testdirector. But for "pass" how to report it to TL.what is the process plz anybody ans

1666






Hello, Is there any way to send the test results in html format (or any other) by email using outlook after the test run ends? thank you in advance

1732


Can we record an application running on a remote machine using qtp?

706


How would you directly trigger javascript in a test?

1460


In what occasion we can specify global sheet and action sheet?

557


Hi Friends... By using QTP , can we test .net products...and that product supports different languages.. thanx in advance..

4116


Explain the features of quick test pro(qtp)?

560


what are the frame work models of qtp?which frame work you follow in your company?and explain it process?

1947


What processes will be required to manage updates to the web site's content, and what are the requirements for maintaining, tracking, and controlling page content, graphics, links, etc.?

596


hi all can anyone explain how to write the code for finding the mandatory columns in table which are having (red*) (red Astrik)

1389


How to use conditional loops in qtp ?

574