Import data from database to datatable
Script to export database data to excel sheet in qtp.
Dim con,rs
Set con=createobject("adodb.connection")
Set rs=createobject("adodb.recordset")
con.provider="microsoft.jet.oledb.4.0"
con.open"d:\db.mdb"
rs.open"select*from EMP",con
Set ex=createobject("Excel.Application")
Set a=ex.workbooks.open("D:\Lak.xls")
Set b=a.worksheets("sheet1")
i=1
Do While Not rs.EOF
b.cells (i,1).value=rs.fields("empno")
b.cells(i,2).value=rs.fields("empname")
b.cells(i,3).value=rs.fields("empsal")
rs.movenext
i=i+1
Loop
a.save
a.close
Above written script is for exporting database data to already exisiting excel sheet.
Database has a table called EMP with columns empno,empname,empsal.The values of these columns are exported to excel sheet.
Excel Sheet Creation and Writing Data Into It
Data Driven Using Excel Sheet
Data Driven Using Notepad
SQL Queries Collection
Movie Songs Lyrics
Showing posts with label export database data to excel sheet qtp. Show all posts
Showing posts with label export database data to excel sheet qtp. Show all posts
QTP Script to Export Database Data to Excel Sheet
Subscribe to:
Posts (Atom)