-
Detecting ODBC Drivers For Oracle using VBA
Hi,
I have an excel workbook containing database queries that uses ODBC driver to extract data from an oracle database . However different machines have different versions of the oracle ODBC drivers installed and so although the code works on my machine, it doesn't on others because the ODBC connection reference is different (refers to a different driver).
So as a first step, I would to know if I can use VBA in Excel to automatically find what ODBC drivers are installed when the macro is run so that I could dynamically change the ODBC connection reference depending on what drivers are installed/found.
The connection strings relating to ODBC drivers are in following formats:
Machine A: "ODBC;DRIVER={Oracle OraDb11g_home1}
Machine B: "ODBC;DRIVER={Oracle in instantclient11_1}
ETC
All machine run windows XP.
Alternatively would there be an easier way to connect to the database than going through an external installed ODBC driver?
Thanks,
Lucas
-
Re: Detecting ODBC Drivers For Oracle using VBA
The connection works just as well with Ms Word-I guess obviously because most general VBA statement work across all MS Suite applications...word, excel, powerpoint... The beauty is that the Scott/tiger username/password combination can connect to any oracle db so long as the dBA has not deliberately disabled the use privileges. therefore you do not have to disclose higher privileged username and password on the VBA code.