0

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.

ModeLearner
  • 21
  • 1
  • 5

2 Answers2

0

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)

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • On my 64 bit machine, ODBC data source is at C:\Windows\SysWOW64 and on my 32 bit machine, ODBC data source is at c:\windows\system32 I am setting environment variables like PATH, TNS_HOME, ORACLE_HOME using _putenv() in code. I am creating DSN in code using connstring like DSN=%s;UID=%s;PWD=%s. – ModeLearner Nov 23 '16 at 08:15
0

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.

ModeLearner
  • 21
  • 1
  • 5