Interview Questions   Tutorials   Discussions   Programs   Videos   

QTP - How to retrieve the data from database?




254
views
asked marvit August 29, 2014 08:31 AM  

How to retrieve the data from database?


           

1 Answers



 
answered By Dharma   0  
Code below can be used to read data from database in QTP.



Set db = createobject("ADODB.Connection")
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=G:\priyanka\vb6\admission_project.mdb;Persist Security Info=False"

Set rst = createobject("ADODB.Recordset")

rst.Open "select * from Course ", db,3

id = rst.RecordCount

For i=0 to id-1
print rst.fields(0) & rst.fields(1) & rst.fields(2) & rst.fields(3)
rst.Movenext
Next
flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert