WORKING WITH QTP

TestEveryThinG

How to Connect oracle database through QTP SCRIPT

Posted by rajivkumarnandvani on May 10, 2008

”””””””””””””””
Set objCon=CreateObject(“ADODB.Connection”)
Set objRec=CreateObject(“ADODB.Recordset”)
objCon.Open  “Driver={Oracle in OraHome92};” & “SERVER=”& Servicename &”;”& “UID=”&   Username &”;” &”PWD=”& Password &”;” &”DBQ=”& Servicename &”;”  “DRIVER={Oracle in OraHome92};SERVER={Servername};UID={Username};PWD={Password};DBQ={Dbnmae}”
objRec.Open “select  *  from users”,objCon
While( objRec.BOF eqv 0 )
objRec.MoveNext
Msgbox “Result” & objRec.Fields(0) &”   “& objRec.Fields(1)
Wend

objRec.Close
objCon.Close
Set objRec=Nothing
Set objCon=Nothing
Msgbox “Executed Sucessfully”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: