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").

Questions by vijaykumary

Showing Answers 1 - 2 of 2 Answers

annjose

  • Dec 26th, 2005
 

right click ont he database table.

sheet->import->database

create the connection

write the sql

ann jose

  Was this answer useful?  Yes

ramkumary

  • Sep 29th, 2006
 

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.

Give your answer:

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

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions