title: Is it possible to have a 32 bit ODBC connection on Windows 10 without a tnsnames.ora file?
body: <p>I have a VBA (Excel) macro that connects to and queries an Oracle database.  Running under Windows 7, the following connection string works: </p>
  
  <pre><code>Driver={Microsoft ODBC for Oracle}; Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=xxx))(CONNECT_DATA=(SERVICE_NAME=name))); Uid=username;Pwd=password;
  </code></pre>
  
  <p>I and the rest of the users of this Excel template are being transitioned to Windows 10 (64 bit), with 32 bit Office 365.  What I like about this connection string is that it doesn't require a separate tnsnames.ora file, a feature I'd like to keep.  I also know that the Microsoft drivers are being deprecated (and it doesn't work out of the box anyway), so the time to change it is now.  </p>
  
  <p>I have the following installed: </p>
  
  <ul>
  <li>Oracle Instant Client 12.2 (32 bit)</li>
  <li>Oracle ODBC Drivers for Instant Client 12.2 (32 bit)</li>
  <li>Visual Studio 2019 (32 bit)(assuming the Oracle drivers are forward-compatible)</li>
  </ul>
  
  <p>I have verified that: </p>
  
  <ul>
  <li>the first value in PATH is set to the directory where Instant Client 12.2 is installed</li>
  <li>ORACLE_HOME is set to the same directory</li>
  <li>there is only one ORACLE_HOME variable</li>
  <li>The driver (Oracle in instantclient_12_2) is visible in the 32 bit ODBC admin tool</li>
  </ul>
  
  <p>I've tried various tweaks of the following connection string, with no luck</p>
  
  <pre><code>Driver={Oracle in instantclient_12_2}; Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=xxx))(CONNECT_DATA=(SID=name))); Uid=username;Pwd=password
  </code></pre>
  
  <p>I've tried using "Data Source" in place of "Server", "SERVICE_NAME" in place of "SID", and both at the same time.  I've also tried the string in Excel 365's internal ODBC connection.  The error I keep receiving is: </p>
  
  <blockquote>
    <p>ORA-12560: TNS:protocol adapter error</p>
  </blockquote>
  
  <p>I'm starting to get the suspicion that a tnsname.ora file is necessary under Windows 10. Is it possible to create a Windows 10 32 bit OBDC connection without using a tnsnames.ora file or any other actions aside from installing the Oracle drivers on a user's machine? </p>
  
  <p>Edit: I created a remotely accessible tnsnames file.  When the connection string uses that file and the TNS_ADMIN environment variable is set, it connects.  If I use the exact text from the tnsnames file in VBA itself, it does not recognize it (TNS Adapter Error).  I'm going to assume that my suspicion about the Oracle drivers requiring a tnsnames.ora file is true, at least for VBA.  </p>