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
Next

Is This Answer Correct ?    8 Yes 3 No

Post New Answer

More QTP Interview Questions

Can we create user defined functions in qtp?

0 Answers  


suppose our project is developed using java technologies.after complition of the coding developer relesed a build to the testing team.so, what is the process means how we open that documents?what are that documents?plz give reply its urgent

2 Answers  


1--How many functions u develop 2--What is an array 3-- where is ur server 4--U involved in unit testing 5--how ur test the background colour using QTP

0 Answers  


How many tabs are available to view your test in a test pane and what are they?

0 Answers  


How to make arguments optional in a function?

6 Answers   Liquid Crystal,






How to call a function in QTP?

4 Answers  


what ar the challenges do we face while testing webbased applications using the automation tool qtp or any?

4 Answers   TCS,


Explain key word driven frame work?How to use in real time?

2 Answers   HP,


Anybody wants to learn QTP with realtime implementations and complete framework desiging plz contact to this mail id ciraaj@gmail.com

1 Answers  


How to associate function library at a run time?

0 Answers  


What is post recovery scenario?

0 Answers  


hai,i want to select an option from the right click pop up menu.but the qtp is not recognizing the right click pop up menu as a seperate object.can any one tell me the solution.

4 Answers   HP,


Categories