Connection to Oracle ODBC Datasource via Visual Studio

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

which works.
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):

where I get this error:
Connection to Oracle ODBC Datasource via Visual Studio

(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.

Solution 1

Thanks to Wernfried Domscheit I finally got it to work.
Thanks man!
Here is how I did it:

  1. Install Visual Studio

  2. Download Version 18.5 Basic Package / ODBC Package

  3. 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

  4. create C:\oracle\admin and put tnsnames.ora in

    dev =
        (FAILOVER = ON)
        (LOAD_BALANCE = OFF)
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = xxxxx)(PORT = 1521))
        (CONNECT_DATA = 
          (SERVER = DEDICATED)
          (SERVICE_NAME = xxxxxx)
          (SID = ORCL)
  5. Systemvariables →
    Add TSN_ADMIN : C:\oracle\admin to the environment variables
    and C:\oracle\odbc to the path

  6. Open ODBC-Datenquelle-Adminsitrator 32 / 64 bit→ System-DSN and add

    Connection to Oracle ODBC Datasource via Visual Studio

  7. 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 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply