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
What is quicktest professional?
Explain advantages and disadvantages of ddf?
is it possible to add sheets to excel at runtime
i can done the project with QTP in that time i can say how many members in my team size?
can the activities of test case design be automated?
We stored into the objects OR and then write the scripting
How do client side image and server side image work?
Can any one tell me how to write a script for selecting open option in File menu of A word document.here you have to add objects to OR.try like that and give me the ans.i asked this question to so many but no one knows.if any one know the answer plz let me know
Are Shared ORs read-only?
how to compare two bitmaps( 1. clients requirement & 2. Designed by dev) in qtp 8.2 wann clear steps
Can anyone help.i need total excelsheet operations,shortcuts in testing environment from starting onwards....
For which type of project the iterative model is suitable?
any body plz send health care domain project to me with explanation any two modules on that project. mail_id: ranjith_99reddy@yahoo.co.in
How many types of recording facility are available in quicktest professional (qtp)?
Excel sheet having some datas and some datas present in the application (in table). How will you compare these two datas? Write code to fetch datas from Excel sheet.