Connection string to connect to remote Oracle 11g - oracle

I need to connect to a remote Oracle server from VBA. I do not want to install any additional drivers or software to connect as I need to distribute the Excel to the team.
I tried several connection strings giving errors like SQL_HANDLE_ENV failed. or Oracle client and networking components not found. or when use OraOLEDB.Oracle I get Provider not found.
Connection strings tried so far:
"Driver={Microsoft ODBC for Oracle}; CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=servicename))); uid=username; pwd=Password;"
"PROVIDER=MSDAORA.Oracle;DATA SOURCE=hostname;USER ID=username;PASSWORD=Password"
"PROVIDER=MSDAORA;DATA SOURCE=hostname;USER ID=username;PASSWORD=Password"
"Driver={Oracle in OraClient11g_home1};Dbq=servicename;Uid=username;Pwd=Password;"
"Provider=OraOLEDB.Oracle;Data Source=hostname;User Id=username;Password=Password;"
There are some pre defined drivers in windows i suppose. But does it not work for oracle? I use windows 8
Any help greatly appreciated..
I did some more research and came across ODP.net. So the conclusion i think is either use Oracle Instant Client or ODP.net. But i am no sure if any .net Application like ODP.net will work without .Net framework. Please let me know if anyone came across this.

Almost every provider needs an Oracle Client installed. Exceptions are JDBC which is Java and does not work in VBA/Excel and the ODP.NET Mananged Driver. However, ODP.NET Mananged Driver is a .NET assembly and they are not working with COM which is used in VBA/Excel. You would have to write your own wrapper for it.
The .NET framework is part of every Windows installation, there should be no concerns.
btw, did you add Reference for Microsoft ActiveX Data Objects ... to you VBA project?
Looks like you cannot pass by the Oracle Instant Client.

Try this:
Provider=MSDAORA.1;Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = SERVER0123)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = PRODDB)));User Id=USER_ID;Password=USER_ID_PASSWORD
Obviously you need to replace the server, User ID and Password.

Related

Delphi Devart dbExpress driver for Oracle Cloud Direct Mode "ORA-03113:end-of-file on communication channel"

We are currently using Delphi 13.3 and DevArt dbexpress for Oracle 7.2.1.
We are looking to change our Oracle client server database to the the cloud.
We looking into to moving to an Oracle Cloud Autonomous Database via Direct Connect...ie Connection Name = DevArt Oracle Direct.
I can specify the database server in the HostName property of DevartOracleDirect DBX Driver, for example:
SQLConnection.Params.Values['HostName'] := '<your OracleTestHostName>:1521:<your service name>';
I get the following generic error "ORA-03113:end-of-file on communication channel".
If I take the information from TNS names... I use
test_high = (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=xxxx.oraclecloud.com))(connect_data=(service_name=yyyy.oraclecloud.com))(security=(ssl_server_cert_dn="zzzz")))
SQLConnection.Params.Values['HostName'] := 'xxxx.oraclecloud.com:1522:yyyy.oraclecloud.com';
SQLConnection.Params.Values['User_Name'] := 'myUserName';
SQLConnection.Params.Values['Password'] := 'myPassword';
I set my SQLConnection to connected=true then I get "ORA-03113:end-of-file on communication channel". I have worked through some various scenarios and appear stuck at this point.
With the Oracle Cloud database am I missing something else ? like including the security/ssl certificate? or the Oracle Cloud Wallet/Client Credentials in the SQLConnection?
On a side note I also have the dbx SQLServer product and do a direct connect to an Azure SQLServer database and all works very easily.
Looking into this for you I found that you had also posted via the dbExpress forums. It appears that at present, Devart dbExpress Driver for Oracle doesn't support SSL connection in Direct Mode. The Devart teams response can be found here - https://forums.devart.com/viewtopic.php?t=42351

Export Database connection to Oracle Developer

I have a database Connection established in odbcad and Microsoft Access (aswell as working in Excel) via ODBC and want to also get it working in Oracle SQL developer.
It is a Windows SQL Server as far as i know and I have tried several Settings, of which None works. I have also installed Driver for ODBC. I would like to Import Settings into SQL developer as applied in MS Access, is there any possibility?
No, SQL Developer is a Java application and uses a JDBC driver.
But if you look at the odbc properties for your connection, those should largely translate to what you need to define a basic connection.
Oracle:
Server name or IP address of the DB, port # for the listener, and the name of the SID or Service, plus a valid username and password is all you need to connect to Oracle.
What error do you get when you try to connect?
Show us what you're trying.
Update:
You're trying to connect to SQL Server but you're getting"
Native SSPI library not loaded
You're trying to use OS Authentication for your connection. For this to work with the jTDS driver, you need to copy a DLL file named ntlmauth.dll (which is for NT authentication) under the jtds-x.x.x-dist\x86\SSO\ or jtds-x.x.x-dist\x64\SSO\, to any directories in the PATH environment.
Please update your question such that's it's clear you're connecting to SQL Server and share the error message so others can find it.
I imagine this question is a duplicate of many previous iterations of the same challenge.

How to connect sql developer to Oracle database using instant client_12_1

I have downloaded the oracle instant client 12_1 but i'm unable to connect to the oracle database.when i tried using sql developer it is displaying the following error.
The Network could not be established.
I'm using windows 7 and my Oracle_home path is defautly set in the system variables as
path
E:\app\dell\product\11.2.0\dbhome\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
I suspect you've begun the headache of messing with the connection string. I seriously recommend you find the option in SQL Developer that will allow you to connect directly to the server (bypass TNSNAMES) and use EZ Connect. The connection string will look like this:
server.whatevz.com:port/sidname
I don't use SQL Developer, so I can't point to it specifically, but I have used it and configured it as such, and it works fine. I'm a fan of PL/SQL Developer (All Around Automation) myself.

Delphi win32 application to work with Oracle

I have to create win32 client on Delphi, which can work with database on Oracle. The only problem with this task that client have to demand "zero administration".
In other words user downloaded it from our site and ran it without any installing oracle client and tuning tnsnames.ora.
My first aproach was to install apache on server side with connection to Oracle. Our win32 client this case is like web brouser works with Oracle via https.
It works but performance is not so good as expected. Delay in reaction between clent and server side is too long.
Is there any way to acheve my goal (zero adminstration client with good enough performance)?
The product ODAC (Oracle Data Access Components) from DevArt has a "no oracle client needed" mode. This would probably be the easiest solution. You could also just include the Oracle Instant Client with your product and use Oracle's "EZConnect" syntax so that you don't have to configure anything on the client. Using EZConnect allows you to connect to an Oracle Database without using a TNSNames.ora file.

How can I connect to an Oracle database as SYS using an ADO connection string?

I am trying this:
Provider=MSDASQL.1;Persist Security Info=False;User ID=sys;Password=pwd;Initial Catalog=DATABASE;Data Source=OdbcDataSource;DBA Privilege=SYSDBA
But I get the error:
[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed
I'm using Delphi, but answers in any language are welcome.
Clarification:
I am able to connect as a normal user. I run into trouble when I try to connect AS SYSDBA.
You can't connect as SYSDBA using standard System.Data.OracleClient, as stated by this post : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2245591&SiteID=1.
You can do that using ODP .NET (Oracle Data Provider for .NET), or other third parties library. If you're planning to build serious Oracle Application on .NET, I suggest you at least look at ODP.NET
I'm not sure what you mean by connecting as a SYS, but there here is a link to sweet repository of connection strings. I hope you can find your answer there.
Posting the answer here as this is the top result when looking for an answer for DBA PRIVILEGE connection string
Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ORCL))); User ID=sys; Password=syspassword; DBA PRIVILEGE=SYSDBA
using Oracle.ManagedDataAccess,
the connection string for sys as sysdba is:
Data Source=myOracleDB;User Id=SYS;Password=SYS;DBA Privilege=SYSDBA;
ref
Oracle Connection string sample
You must have your Oracle SID defined in your TNSNames file. Which is the data source.
Data Source=oracl;User Id=userID;Password=password;Integrated Security=no
If you are using Visual Studios you can add a data source in the Sever Explore and it will give you the connection string.

Resources