Skip to content

[UFT] Connection String for Oracle

New Discussion
Felino
Felino asked on Jan 19, 2016 3:07 PM

Hi,
i’m using SQL Developer for to connect to the database.
I have this parameters:
– username
– password
– hostname
– port
– SID

In VBScript, which is the connection string correct?

I tried more different connection strings, but nothing works.

Thanks.

Sign In to post a reply

Replies

  • 0
    Michael DiFilippo
    Michael DiFilippo answered on Dec 28, 2015 7:41 PM

    Hello Roberto Salemi,

    Thank you for reaching out. I did some research to find the collection of connection strings you can use to connect to your Oracle DB and found this page:

    https://www.connectionstrings.com/oracle/

    Let me know if it helps or have any additional questions. Also, I strongly recommend reaching out to your team of developers who created the application your testing to gain more understanding on how to connect to the db.

    • 0
      Felino
      Felino answered on Dec 30, 2015 11:19 AM

      Hi Michael,

      I tried this two connection string:

      1)
      DB_CONNECT_STRING = "Provider=OraOLEDB.Oracle; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" & myHostName & ")(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=" & myServiceNameOrSID & "))); User ID=" & myUsername & ";Password=" & myPassword & ";"
      with this error

      "OraOLEDB: ORA-12514: TSN: Listener dows not currently know of service requeste in connect descriptor".

      2) "Driver={Microsoft ODBC for Oracle};Server=myServerName; Uid=your_username;Pwd=your_password;"

      whit this error

      "Microsoft OLE DB Provider: for ODBC Drivers: [Microsoft Driver Manager] Data source name not found and no default driver specified".


      This is my full code:


      Function ConnectionTest()

      DB_CONNECT_STRING = "Provider=OraOLEDB.Oracle; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" & myHostName & ")(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=" & myServiceNameOrSID & "))); User ID=" & myUsername & ";Password=" & myPassword & ";"

      Set myConn = CreateObject("ADODB.Connection")
      Set objRecordSet = CreateObject("ADODB.Recordset")

      myConn.Open DB_CONNECT_STRING
      objRecordSet.Open myQuery, myConn
      Wscript.Echo objRecordSet.fields.item(1) & " " & objRecordSet.fields.item(2)
      myConn.Close

      End function

      Call ConnectionTest()

       

      Thanks a lot!

      • 0
        Michael DiFilippo
        Michael DiFilippo answered on Dec 30, 2015 2:55 PM

        Hello,

        Based on error message 1, I found this article where others have answered this issue:

        http://dba-oracle.com/t_ora_12514_tns_listener_does_not_currently_know_service_requested.htm

        Based on error message 2 you can learn more about it's symptoms and resolution here:

        https://support.microsoft.com/en-us/kb/306345

        I strongly recommend contacting Oracle for assistance if you have run out of ideas. It's our job at Infragistics to ensure you are setup to properly use our Test Advantage add-on with QTP/UFT.

        Let me know if you have any questions regarding this matter.

      • 0
        Felino
        Felino answered on Jan 15, 2016 1:42 PM

        Hi,
        I have resolved.

        I have modified my ConnectionString as:
        DB_CONNECT_STRING = "Provider=OraOLEDB.Oracle; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=" & myHostName & ")(PORT=" & myPort & "))(CONNECT_DATA=(SERVER=dedicated)(" & serviceNameString & "))); User ID=" & myUsername & ";Password=" & myPassword & ";"
        where I have added 
        SERVER=dedicated

        If i launch my script through MS DOS it works, but If I use it in UFT I have this error:
        "Provider cannot be found, it may not be proprerly installed"

        Why?

        I have added the plugin ORACLE in my project into UFT, maybe it is necessary another plugin?

        Thanks.

      • 0
        Michael DiFilippo
        Michael DiFilippo answered on Jan 15, 2016 4:45 PM

        Hello Felino, 

        Please contact HP support to resolve the issue. 
        https://softwaresupport.hp.com/web/softwaresupport/support-contact-information

        After you have database and application setup ready for testing, please let us know if you have any questions with Test Advantage.  

      • 0
        Felino
        Felino answered on Jan 19, 2016 3:03 PM

        Hi,
        I resolved!

        1) I checked the version of the Oracle database interested.
        2) I installed this version of driver.

        The DB connection in UFT works fine!

        Thanks to all for the good support.

      • 0
        Michael DiFilippo
        Michael DiFilippo answered on Jan 19, 2016 3:07 PM

        Felino, 

        Awesome! Glad you resolved this and your welcome. 

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Felino
Favorites
0
Replies
7
Created On
Jan 19, 2016
Last Post
10 years, 1 month ago

Suggested Discussions

Created by

Created on

Jan 19, 2016 3:07 PM

Last activity on

Feb 23, 2026 6:53 AM