Link to home
Start Free TrialLog in
Avatar of JohannRamon
JohannRamonFlag for Colombia

asked on

How can i connect my 32 bits application to Oracle 10g 64 bits with ODBC?

We have a 32 bit application for Windows Server 2003 32 bits with Oracle 10g 32 bits with most of its components written in Visual C++ 2005 (native, it is not .NET), it has been also certified for Windows Server 2003 64 Bits with Oracle 10g 32 bits without big trouble.

However when trying to certify it with Oracle 10g 64 bits we have had problems connecting to the database. Those problems seem related with the DataSourceNames in ODBC.

Here is one portion of my code in one of the Visual C++ 2005 components:

if( Check(SQLAllocEnv(&hEnv)) &&
    Check(SQLAllocConnect(hEnv, &hDBC)) &&
    Check(SQLDriverConnect(hDBC, NULL, (SQLCHAR*)  "DSN=MyDataSource;APP=CheckBD;", SQL_NTS, NULL, NULL, NULL, SQL_DRIVER_NOPROMPT)) &&
    Check(SQLAllocStmt(hDBC, &hStmt)) )

In some forums i found that for a 32 bits application it is necessary to install the client ODAC 32 bits so i did it.

In another question i found that in a 64 bits Windows Server there are two ODBCs, the one in Administrative Tools-Data Sources (ODBC) which is for 64 bits and the one in C:\WINDOWS\SysWOW64\odbcad32.exe which is the 32 bits, however in the last one i don't see the driver "Oracle in OraDb10g_home1" and i don't know how to add it, the ODAC installation didn't show an option for SYSWOW64.

I am very lost at this.

Thanks and regards,

Johann


When it runs it fails with the following error in the application event viewer:

The description for Event ID ( 0 ) in Source ( SampleService ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: MyApplication error: 9999,
Data source name not found and no default driver specified

I have already
Avatar of Akenathon
Akenathon
Flag of Uruguay image

Your code reads "DSN=MyDataSource". The error reads "Data source name not found". Have you checked that the datasource exists on the machine your code is running, and it has that exact name?
Avatar of JohannRamon

ASKER

I have checked this and the datasource name is the same (in the question i put "MyDataSource" for the sake of understanding and length, the name is different,m longer and there are 4 different datasources), when i test the System DSN from ODBC in administrative tools the test is successful however when i try to test it from C:\WINDOWS\SysWOW64\odbcad32.exe it says "The setup routines for the Oracle in OraDb10g_home1 ODBC driver could not be found. Please reinstall the driver",  and in fact the driver is no t listed in the "Drivers" tab, the ODBC in administrative tools do have it listed.

 User generated image User generated image
Beware that each version of those ODBC should be run by ots own (it looks like they share interface elements and cannot be run at the same time)

My datasources names appear in both versions under the "System DNS" tab.

Thanks and regards,

Johann
Looking in the registry i found that the entry in HKLM\SOFTWARE\ODBC\ODBCINST.INI have the driver "Oracle in OraDb10g_home1" while the one in HKLM\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI don't have it.

The entries point to the place where the database is installed:
D:\oracle\product\10.2.0\db_1\BIN\SQORA32.DLL and
D:\oracle\product\10.2.0\db_1\BIN\SQORAS32.DLL
So they are 64 bits versions
Those files are only there, they are not present in the directory where i install the 32 bits client (ODAC1020221.exe)

User generated image
Trying to add those registry entries in the Wow6432Node made the driver entry appears in the 32 bits ODBC but when trying to configure the datasource i received the errors: "The setup routines for the Oracle in OraDc10g_home1 ODBC driver could not be loaded due to system error code 193" and "Could not load the setup or translator library". I know that was a silly experiment because i was referencing the same SQORA32.dll but wanted to give it a try.

Johann
ASKER CERTIFIED SOLUTION
Avatar of JohannRamon
JohannRamon
Flag of Colombia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
One of my colleagues at work help me find this solution