08-27-2010, 04:12 PM
Hi Rajeshwar,
Please find the below code which i have done on flight application.
The following code fetch the data from database to data table.
Please let me know for further clarification.
Regards,
Venkat. Batchu
Please find the below code which i have done on flight application.
The following code fetch the data from database to data table.
Code:
Dim adocon,adorecordset
Set adocon=CreateObject("ADODB.Connection")
constr="DSN=QT_Flight32;DBQ=C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight32.mdb;Driver=C:\WINDOWS\system32\odbcjt32.dll;DriverId=281;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5"
adocon.Open constr
Set adorecordset=CreateObject("ADODB.Recordset")
Set adorecordset.ActiveConnection=adocon
Strsql="Select * from orders"
adorecordset.Source=Strsql
adorecordset.Open
set outsheet=Datatable.Addsheet("output")
For each fld in adoRecordset.Fields
outsheet.AddParameter fld.name,""
Next
i=1
Do while Not adorecordset.EOF
DataTable.SetCurrentRow(i)
For each fld in adorecordset.Fields
outsheet.GetParameter(fld.name).value=fld.value
Next
adorecordset.MoveNext
i=i+1
Loop
Wait 5
Please let me know for further clarification.
Regards,
Venkat. Batchu