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

where the check points are stored ?

3 Answers   IBM,


How to capture text from image to word

2 Answers  


What are the types of data tables in qtp?

0 Answers  


What is the difference in the global and action sheet in qtp?

0 Answers  


How can you identify the browser and its information using QTP script?

0 Answers  


How to handle Recovery scenario in QTP. give detailed explanation about recovery scenario.

1 Answers  


How to use Environment parameterization? Explain with an example.

0 Answers  


How can I find out the cursor position through QTP suppose I am keep tabbing(Pressing the tab key continuously) and stoped at a position Now I want to find out where the cursor position is

0 Answers   HP, Livetek,


WAT IS DATA BASE AND XML CHECK POINT ?HOW TO IMPLEMENT IT ... GIVE PROPER EXAMPLE FOR IT

0 Answers   Infosys,


Thanks Rag... One more question, How we test the dynamic images which frequently changed?Using the bitmap checkpoint r any other options available.... Can u give the steps pls... Thanks

1 Answers  


In QTP, Give the difference of Global sheet and Local sheet in datatable?

3 Answers  


Does QTP support flat files? If yes what are those?

2 Answers  


Categories