Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

how to retrieve the column headers in database using
vbscript statement in QTP

how to retrieve the column headers in database using vbscript statement in QTP..

Answer / akothuru

VB Script Code to retrieve all column names

var_ConnectionString = "" 'specify the connection string
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open var_ConnectionString
Set objRecordSet = CreateObject("ADODB.RecordSet")
strSqlQuery = "select * from employee"
'Execute query and Store the results into Record set
objRecordSet.Open strSqlQuery, objConnection
For var_Loop = 0 To objRecordSet.Fields.Count - 1
colname = objRecordSet.Fields(var_Loop).Name 'column name
msgbox colname

Is This Answer Correct ?    8 Yes 3 No

Post New Answer

More QTP Interview Questions

Hi All, Can anyone provide me the license for QTP 9.5.... My Email ID:

0 Answers  

I need diffrences between Object Identification, Smart Identification, Regular expresion,Low-Level Recording (enables you to record on any object in your application, whether or not QuickTest recognizes the specific object or the specific operation.) I am working on Web Application. In that object caption will change dynamically. For example, consider “Save” button. On clicking save button the caption changing as “ EDIT ”. From above concept which concept I have to use here?

2 Answers   Ordain Solutions,

Hi Friends, I'm new to QTP. I want to write a function in QTP for below senario. In an Excel sheet column B, I Have 10 Url/Links, and in Colum A there is a Flag as Y and N. My test should run only on those iterations which are flagged as Y. Please help, Thanks

6 Answers  

Hi let me ask one questin 1.How to use outputof the one function input to the another function pls give the script for above 2.what is the purpose of action parameter , how to create it

2 Answers  

write script for "dropdown button having how many words? for ex.SELECT CITY is dropdown name.. find out how many cities in that?

1 Answers  

how to record a word doc using qtp i.e open a word doc,type something and save the doc can someone send me the code.

3 Answers  

How to work with multiple browsers when opened in the window, write the script for it

2 Answers   Verizon,

How can you handle exceptions in qtp?

0 Answers  

How i can use and create Library functions in QTP and what is the proces .

2 Answers  

What is Object Spy in QTP?

1 Answers   Crea,

Hi ,Can any one pleas explain how to test splash objects using QTP?

0 Answers   Value Labs,

Synchronization methods?

8 Answers   Ordain Solutions,