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
how can i pass a "automation script" as a parameter in a function give me need full suggestion thank inadvance
How does QTP identify an object?
What is Distributed testing? How does UFT support it?
Can anyone pls tell me how to do action parameterization (input and output parameters) with respect to login window and insert order of flight reservation window in detail( pls give a clear step by step explanation with example) anyone please. Will be very thankful to u
If the weblist is identified as webelement,and by clicking on webelement if the values are displayed,and if the values the values also identified as webelement.then how to fetch the values through script?
If the objects hierarchy is changing from build to build, then how you will handle that condition?
Explain about datafile/verification of date file when file is not available in local system?
How many types of recording modes in qtp? Describe each type with an example where we use them?
Is virtual object supported in low level recording mode?
What is smart identification in QTP?
What are the different types of recording modes?
What is CMMP and CMMH?
Hi friends I need to know about jubula automation tool. Is anybody know in bangalore where jubula tanning class is going on do let me know. Its urgent for me to learn that tool please help.
How many types of run modes are there in qtp?
What is qtpro? What is a quick test professional?