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

Hi All, I Want To excute scripts batch without using QC .I need code for that Thanks Balaji

1531


Explain how you can find the absolute value of the number in qtp?

826


i have two questions for regular expression :- Q1. I have date pattern eg-29/11/2011 29-11-2011 29.11.2011 Que- if any separator is there between date,month and year pattern should match else it should not match eg- pattern should not match in case of 2911-2011 Q2. let say i have a string and there is a number in between of that string eg.-Amount 30002.234 successfully credited to your account . now i have to match this pattern in such a way that even if decimal is not there pattern should match ,how i will do this using regular expression

1211


Which advantages helping QTP to hold the position of "Market Leader" for such a long period?

1572


Difference between action & Reusable action?

821


Get the count of files of similar types from a folder.

1191


Where to use Property Let, Property Get, Property Set in UFT

573


Which environments are supported by hp qtp?

750


how will you check how many members visited the website www.infosys.com?

1660


Generic function to search for the unique link in webtable and click on it

2721


after click on compose mail how can we attached a file in qtp with vbscript code

1850


what type of framework u r using in ur organization

1820


How can I open a EXCEL file from QTP Resultviewer with reporter.ReportEvent function call. Example: Test files for details click "here". And clicking "Here" in the resultviewer will open a local EXCEL FILE.

2021


Can UFT be connected to Quality Center? If ‘Yes’ brief the process or steps.

820


Can we record using all the modes in a single script? Explanation with example is appreciated

1586