I would like to connect to a oracle db in our network, but I do not know how.
In visual code, we use this .env for our database connection:
# db credentials ORACLEDB_USER=x ORACLEDB_PASSWORD=x ORACLEDB_HOSTNAME=xxxx ORACLEDB_PORT=1521 ORACLEDB_SERVICE_NAME=xxxx IF_INV_PATH= inv_target_path= TIFF_PATH_ROOT= inv_path=
When I now try to use the Visual Studio ODBC Server connection I have to use a connection string.
I tried something like this (found via google):
(which loosely translates to: Datasource not found, and no default driver given)
I’m pretty confused and have no experience with setting up a connection to a oracle db.
I have installed the x64 driver from this site:
But it doesn’t change anything.
Here is Solutions:
We have many solutions to this problem, But we recommend you to use the first solution because it is tested & true solution that will 100% work for you.
Thanks to Wernfried Domscheit I finally got it to work.
Here is how I did it:
Install Visual Studio
Download Version 18.5 Basic Package / ODBC Package
unzip both in the same directory (I choose C:\oracle\odbc\x86(x64)\instantclient_18_5) and install the driver via cmd as admin: C:\oracle\odbc\x86\instantclient_18_5>odbc_install.exe
create C:\oracle\admin and put tnsnames.ora in
dev = (DESCRIPTION = (FAILOVER = ON) (LOAD_BALANCE = OFF) (CONNECT_TIMEOUT=3) (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxx)(PORT = 1521)) ) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = xxxxxx) (SID = ORCL) ) )
Add TSN_ADMIN : C:\oracle\admin to the environment variables
and C:\oracle\odbc to the path
Open ODBC-Datenquelle-Adminsitrator 32 / 64 bit→ System-DSN and add
Open Visual Studio → Server Explorer → Connect to Database → Microsoft ODBC Data Source (ODBC) and choose your user / system data source name
Note: Use and implement solution 1 because this method fully tested our system.
Thank you 🙂