GeekInterview.com
Series: Subject: Topic:
Question: 745 of 785

how to fetch test data from Database by using QTP?

In order to fetch test data from Database we have to create a adobdb connection object to connect with data base. the syntax is .... >CreateObject("Adodb.connection").
Asked by: vijaykumary | Member Since Sep-2005 | Asked on: Sep 18th, 2005

View all questions by vijaykumary

Showing Answers 1 - 2 of 2 Answers
annjose

Answered On : Dec 26th, 2005

right click ont he database table.

sheet->import->database

create the connection

write the sql

ann jose

  
Login to rate this answer.
ramkumary

Answered On : Sep 29th, 2006

View all answers by ramkumary

Hai

Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adUseClient = 3
Set objCon=CreateObject("ADODB.Connection")
Set objRec=CreateObject("ADODB.Recordset")
objCon.Open "DRIVER={Oracle in OraHome92};SERVER={Servername};UID={Username};PWD={Password};DBQ={Dbnmae}"
objRec.CursorLocation = adUseClient
objRec.Open "Select {Col name} from tablename",objCon,adOpenStatic,adLockOptimistic
While(objRec.EOF)
    objRec.MoveNext
    Msgbox "Result" & objRec.Fields.Item("{Col name}")& vbCrLf 
Wend

objRec.Close
objCon.Close
Set objRec=Nothing
Set objCon=Nothing
Msgbox "Executed Sucessfully"

ramyoganathan@aim.com

Warm reg

Ram.

Yes  1 User has rated as useful.
  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.