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.
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.
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_STRINGobjRecordSet.Open myQuery, myConnWscript.Echo objRecordSet.fields.item(1) & " " & objRecordSet.fields.item(2)myConn.Close End function Call 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_STRINGobjRecordSet.Open myQuery, myConnWscript.Echo objRecordSet.fields.item(1) & " " & objRecordSet.fields.item(2)myConn.Close
End function
Call ConnectionTest()
Thanks a lot!
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.
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=dedicatedIf 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.
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.