0
votes

I have developed an app in VC++ to make connect to Oracle DB and access its data. It requires a DSN to be created and some environment variables like PATH, ORACLE_HOME, TNS_ADMIN, etc. to be set which I have done programmatically in my VC++ code. I have updated required registry entries. I have installed 32bit Oracle Instant Client on my machine.

http://download.oracle.com/otn/nt/instantclient/121020/instantclient-basic-nt-12.1.0.2.0.zip http://download.oracle.com/otn/nt/instantclient/121020/instantclient-odbc-nt-12.1.0.2.0.zip

I have complied and built the application exe using Win32 option as target platform on Windows 7 64 bit machine. This exe works fine on Windows 7 64 bit machine and I am able to make the DB connection successfully using SQLDriverConnect().

But when I do same setup on Windows 32 bit machine like installing 32bit Oracle Instant Client, setting some environment variables like PATH, ORACLE_HOME, TNS_ADMIN, etc., updating required registry entries and try running same application exe (used on 64 bit machine), this gives following error:

[Microsoft] - [ODBC Driver Manager] Data source name not found and no default driver specified.

Please suggest the resolution steps.

2
What is the driver name in ODBC? Is it the same name (e.g. Oracle in OraClient12g_home1) for both installations?Wernfried Domscheit

2 Answers

0
votes

Where did you define your ODBC data sources? You have to do this separately

for 64-bit use %SYSTEMROOT%\system32\odbcad32.exe (typically c:\windows\system32\odbcad32.exe)

and for 32-bit use %SYSTEMROOT%\SysWOW64\odbcad32.exe (typically c:\Windows\SysWOW64\odbcad32.exe)

0
votes

Thanks all for your response.

Anyways I have fixed the issue.

As I mentioned earlier that I am creating DSN and updating registry entries for DSN programmatically, registry path should be different for 64 bit machine and different for 32 bit machine.

On 64 bit machine, DSN registry path would be:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI]

On 32 bit machine, DSN registry path would be:

[HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI]

This resolved my issue after making DSN registry entries at new path in registry for 32 bit machine.