How do we connect to Oracle database from QTP ?

Showing Answers 1 - 4 of 4 Answers

Uma

  • Jun 7th, 2006
 

Either we can user Microsoft Query Wizard,or we can connect by harcoding the DB Connection string and all in Expert view.

We have to create a new DSN or we can use the existing DSN to connect to the database.

  Was this answer useful?  Yes

shashi

  • Jun 8th, 2006
 

By using ABODB object

  Was this answer useful?  Yes

syamkumar

  • Jun 11th, 2006
 

Hi

Can u please send me the sample code, I Checked the entire help but I didn't found for functions available to connect backend in the QTP.

  Was this answer useful?  Yes

Radhamohan

  • Jun 22nd, 2006
 

'---------------------------------------------------------------------------------------
'Name: OpenConnection
'Function: Opens a connection to the required database
'Input Parameter:  strDriver, strServer, strUserID, strPassword
' strDriver => Name of Database Driver to be used
' strServer => Database Server address
' strUserID => User ID to connect to database
' strPassword => Password to connect to database
'Return Value: con => Object: Connection to database
' NULL if it fails
'Calls: None [Calls no other user defined function]
'---------------------------------------------------------------------------------------
Function OpenConnection(byval strDriver,byval strServer,byval strUserID,byval strPassword)

 Dim strConnectionString
 strConnectionString = "DRIVER=" & strDriver & ";SERVER=" & strServer & ";UID=" & strUserID & ";PWD=" & strPassword
 set con = createobject("adodb.connection")
     con.open strConnectionString
     set OpenConnection = con

End Function

  Was this answer useful?  Yes

Give your answer:

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

 

Related Answered Questions

 

Related Open Questions