title: SQLException 32104 in OCCI
body: <p>I am trying to use OCCI to connect my program to an oracle database but I am getting an SQLException 32104 when I try the createEnvironment function.</p>
  <p>My code:</p>
  <pre><code>#include &lt;OpenXLSX.hpp&gt;
  #include &lt;occi.h&gt;
  #include &lt;string&gt;
  
  using namespace OpenXLSX;
  using namespace oracle::occi;
  
  int main() {
  
      std::string user = &quot;&quot;;
      std::string pass = &quot;&quot;;
      std::string conn_str = &quot;(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.159)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=test)))&quot;;
  
      std::cout &lt;&lt; &quot;Initializing Database Connection ......&quot; &lt;&lt; std::endl;
  
      try {
          Environment* env = Environment::createEnvironment(Environment::DEFAULT);
          //Connection *conn = env-&gt;createConnection(user, pass ,conn_str);
      } catch(SQLException &amp;e) {
          std::cout &lt;&lt; &quot;Error Message: &quot; &lt;&lt; e.getErrorCode() &lt;&lt; std::endl;
          std::cout &lt;&lt; e.getMessage() &lt;&lt; std::endl;
      }
      std::cout &lt;&lt; &quot;Initializing Database Connection ......&quot;;
      
  
      std::cout &lt;&lt; &quot; OK&quot; &lt;&lt; std::endl;
  
      XLDocument doc;
      doc.open(&quot;Template.xlsx&quot;);
      auto wks = doc.workbook().worksheet(&quot;Extruder Data Log&quot;);
  
      int row_number = 4;
      char column_letter = 'A';
      char column_letter2 = 'A';
      std::string loc;
  
      loc = column_letter;
      loc += std::to_string(4);
  
      wks.cell(loc).value() = &quot;Hello, OpenXLSX!&quot;;
  
      doc.save();
      //env-&gt;terminateConnection(conn);
      //Environment::terminateEnvironment(env);
  
      std::cout &lt;&lt; &quot;Program Terminated: Press Enter ...&quot;;
      std::string wait;
      std::cin &gt;&gt; wait;
  
      return 0;
  }
  </code></pre>
  <p>I am using CMake to compile:</p>
  <pre><code>cmake_minimum_required(VERSION 3.15)
  project(Atlas)
  
  set(CMAKE_CXX_STANDARD 17)
  
  # Set the build output location to a common directory
  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
  set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/include/lib)
  
  add_subdirectory(OpenXLSX)
  
  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/include/OpenXLSX/headers)
  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/include/OpenXLSX)
  include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/include/OCCI)
  link_directories(${CMAKE_PREFIX_PATH})
  find_package(OpenXLSX REQUIRED)
  find_library(OCCI NAMES oraocci21.lib oci.lib oramysql.lib oraocci21d.lib ociw32.lib)
  
  add_executable(Atlas Atlas.cpp)
  target_link_libraries(Atlas OpenXLSX::OpenXLSX)
  target_link_libraries(Atlas ${OCCI})
  </code></pre>
  <p>I have the dlls in the output directory where the executable and libraries end up outputting to.
  I figure that it should run, but I am getting a Microsoft C++ exception: oracle::occi::SQLException
  and on debugging it shows that it is message 32104 which I know means that it cannot get the error.</p>
  <p>The Debug window show that it loads the oraocci21.dll but not any of the other OCCI dlls.</p>
  <p>If anyone can let me know what I'm doing wrong I would be incredibly grateful since I have scoured the internet trying to figure this out.</p>
  <p><strong>EDIT</strong></p>
  <p>Figured out this error, I hadn't moved all of the dlls from the instant client. I was only including the dlls that corresponded to the library names.
  I included ocijdbc21.dll, orannzsbb.dll, and oraociicus.dll to the folder with my executable and it now runs past the createEnvironment(Environment::DEFAULT) part.</p>
  <p>With this edit, though, I am now running into Error 24960 which says that OCI_ATTR_USERNAME is more than length 255 which it is not.
  If anyone can help with that please let me know but I hope that anyone else running across this who needs help sees the part about the dlls.</p>
  <p>If it helps to answer my question, I am using instant client base 21_3 and sdk 21_3. I am also using MSVC 16 2019 for compilation with C++17 as the version of C++. My Oracle Database is running on 19c and I can connect to it remotely.</p>