0

situation:

  • working on .net application (using ADODB.connection) that need to connect to wide range of oracle versions (from 19c to 8i)
  • multiple oracle clients installed in pc
  • 10.2.0 (this is required to connect to oracle 8i)
  • 11.2.0 (this is required to connect to oracle 19c)
  • .net application seems to stick to use either 10.2.0 or 11.2.0 client. When 10.2.0 is used, connection to 19c failed. When 11.2.0 is used, connection to 8i failed.

Question: How to programmatically choose oracle client based on oracle database version to connect to? i.e. How to programmatically use client 10.2.0 when connecting to oracle 8i and use client 11.2.0 when connecting to 19c?

Please let me know if any additional information is needed.

Thanks.

Jach
  • 557
  • 5
  • 12
  • What do you mean by "ADODB.connection"? See https://stackoverflow.com/questions/34803106/how-to-connect-to-oracle-11-database-from-net/34805999#34805999 – Wernfried Domscheit May 30 '23 at 07:26
  • This will be difficult, because you need to change the `PATH` environment variable (before the process starts) See also https://stackoverflow.com/questions/44818069/how-to-load-specific-version-of-assembly-from-gac – Wernfried Domscheit May 30 '23 at 07:29
  • @Wernfried. Thanks for the response. By "ADODB.Connection" => This is what I found by "go to definition" in vs2019.
    #Region "Assembly ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" ' C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\adodb.dll #End Region
    – Jach May 30 '23 at 10:02
  • How do you connect to the Oracle database? It looks like you are using (30 years old) COM libraries. There you can install only one version (i.e. one each for 32bit and 64bit). You could compile two clients, one with 32bit the other with 64 bit. Then depending which database you like to use, start the 32bit or 64 bit program. – Wernfried Domscheit May 30 '23 at 12:27
  • @Wernfried. I guess it is more than 30 years old :) I was hoping I missed something and it is possible to do without moving to modern world (stop using that ancient ADODB). I guess I do have to explore other ways to connect (checking out Oracle.ManagedDataAccess). Thanks for your time helping on this. – Jach May 31 '23 at 01:05

0 Answers0