Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to retrieve data from
flight resevation->reports

Answer Posted / jegan

''Connect to the DataBase
Function getConnection ()
On Error Resume Next
Dim oConnection, oConnectionString
'oConnectionString = "Provider=SQLOLEDB; Data
Source=192.168.10.104; Initial Catalog=UASC; User
Id=developer; Password=tiger!@;"
oConnectionString ="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Program Files\HP\QuickTest
Professional\samples\flight\app\flight32.mdb; User Id=admin;
Password=;"
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open oConnectionString
Set getConnection = oConnection
End Function

'Check that database connected or not
'Dim MyConnString, MyConnection
'Set MyConnection = getConnection
'If MyConnection.Errors.Count = 0 then
' msgbox "Database Connected"
'Else
' msgbox Err.Description
'End If

''Retrieve DB Records
Function getRecordset (strSQL)
On Error Resume Next
Dim oConnection, oRecordSet
Set oConnection = CreateObject("ADODB.Connection")
Set oRecordSet = CreateObject("ADODB.Recordset")
oConnection = getConnection()
oRecordSet.Open strSQL,oConnection,adOpenStatic
Set getRecordset = oRecordSet
End Function

''Get recordset
Set MyRecordset = getRecordset ("Select * from Orders" )
''Get number of columns in table
nColumns = MyRecordset.Fields.Count
''Add a sheet in your datatable
Datatable.AddSheet ("DBImport")
For n = 0 to nColumns-1
''Get column name
ParamName = MyRecordset.Fields(n).Name
''Add DTParameter
Datatable.GetSheet("DBImport").AddParameter
ParamName, ""
nRow = 1
MyRecordset.MoveFirst
''Retrieve and place data in data table
Do while MyRecordset.EOF <> True
Datatable.SetCurrentRow(nRow)
Datatable(ParamName,"DBImport") =
MyRecordset.Fields(ParamName)
nRow = nRow + 1
MyRecordset.MoveNext
Loop
Next

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

action contains public and private functions but do we resuable that action or not..If it is reusable How..plz tell me the ans

2025


Why qtp always start action1 and does not start action?

1086


Which environments does qtp support?

1088


What is environment variable in qtp and why to use it?

986


What is the qtp testing process?

1023


Consider one application is open, clicking one menu will open another application in another browser. QTP does not catch the URL of the second browser(second application). can we capture it ?

1924


What is QTP and the use of QTP in TD?

1063


Can anyone help.i need total excelsheet operations,shortcuts in testing environment from starting onwards....

2000


How to capture all the data of a webtable, weblist and combolist using QTP?

3326


Hi How to retrieve data from web element line by line?

2036


How QTP support all types of applications (platforms)?

4523


How to associate function library at a run time?

1114


What do you mean by iteration?

1189


what type of automation is follwed in the project?

1911


Can any body please tell me the steps of keyword driven frame work in qtp. My mail is saswat445@gmail.com please send some materials on keyword driven testing in qtp. thanks a lot...

2222