Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Importing Data from a Database
#4
Solved: 10 Years, 10 Months ago
Hi,

You can use the below code to work like Datatable.Import i.e which will add all the field names (available in data base) to excel i.e outsheet

Code:
set outsheet=Datatable.Addsheet("output")
'This for loop is used to add the fields to excel
For each fld in adoRecordset.Fields
    outsheet.AddParameter(fld.name)
Next
While adorecordset.eof( )
'This for loop is used to add the field values to respective field names.
For each fld in adorecordset.Fields
    outsheet.GetParameter(fld.name).value=fld.value
Next
Loop

Please let me know if you need any clarification

Regards,
Venkat.Batchu
Reply


Messages In This Thread
Importing Data from a Database - by rajeshwar - 05-26-2010, 12:44 PM
RE: Importing Data from a Database - by Saket - 05-26-2010, 01:03 PM
RE: Importing Data from a Database - by rajeshwar - 05-26-2010, 02:48 PM
RE: Importing Data from a Database - by venkatbatchu - 07-14-2010, 03:15 PM
RE: Importing Data from a Database - by qtp-qa - 04-03-2012, 12:23 AM
RE: Importing Data from a Database - by lotos - 09-14-2010, 08:45 PM
RE: Importing Data from a Database - by lotos - 11-23-2010, 08:40 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Importing excel not working Adam82 6 13,226 11-05-2012, 05:22 PM
Last Post: Adam82
  it is possible import from excel to table with expected data of checkpoint database i sarcastic 0 2,208 08-05-2011, 04:42 PM
Last Post: sarcastic
Smile importing objects and properties to excel sheet sandy.jakhar 2 3,581 03-16-2011, 03:26 PM
Last Post: sandy.jakhar
  mapping database user to database kamalteja 4 4,551 11-03-2010, 11:58 AM
Last Post: kamalteja
  Data importing from excel using script vaigundamoorthy 3 3,559 05-19-2009, 04:53 PM
Last Post: lit_73

Forum Jump:


Users browsing this thread: 1 Guest(s)