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
LVL 2
JohannRamonAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AkenathonCommented:
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?
JohannRamonAuthor Commented:
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.

 From administrative tools From syswow64 odbcad32.exe
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
JohannRamonAuthor Commented:
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)

Registry01
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
JohannRamonAuthor Commented:
I think this information can be helpful for somebody else migrating fromn 32 to 64 bits Oracle.

Just this week we finally got it working following those steps:

Install 32 bits client ODAC101040:
  Home will be something like: OraClient10g_home1
  Choose a destination directory i.e d:\oracleclient

Install 32 bits ODAC1020221:
  Use the same home: OraClient10g_home1
  Use the same destination directory: i.e. d:\oracleclient

Change in InstallShield or the client program “Oracle in OraDb10g_home1” for “Oracle in OraClient10g_home1”

Regards,

Johann

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JohannRamonAuthor Commented:
One of my colleagues at work help me find this solution
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.