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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi can anybody send me the QTP material, To my email ID: nuve1284@gmail.com ?

1890


What are the types of data tables in qtp?

756


How to handle Java tree in QTP?

993


how will you load the test cases in ddt?

1796


Does QTP record on Objects created on XWindows Environment?

1858


What is Cross browser testing? Does UFT support it?

790


What are the different attribute used with regular expression?

705


In Remote acess server how u run a test?

1453


Explain in brief about the qtp automation object model (aom).

727


Explain the check points in quicktest professional (qtp)?

764


How many types of recording modes are there?

775


can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?

1611


how can we test the Triggers, Cursors, Indexes while doing Database testing in DTP??

1801


what are the challenges you have faced while testing web based application using the automation tools ?

819


I want to do Certification course in QTP. For this I request you to suggest the best Tutorial in PDF format. Hence, if possible, kinldy mail PDF file to my mail-ID: sushmapokhriyal79@gmail.com

1699